Ubuntu下配置IP地址的方法:
为网卡配置静态IP地址。
1.打开终端输入以下命令打开网卡配置文件。
sudo vi /etc/network/interfaces
2.使用以下代码来替换有关eth0的行。
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.2.1
gateway 192.168.2.254
netmask 255.255.255.0
#network 192.168.2.0
#broadcast 192.168.2.255
注:将以上ip地址等信息配置成你自己的
3.再输入以下命令使修改生效便可。
sudo /etc/init.d/networking restart
本文来源:https://www.yuntue.com/post/74322.html | 云服务器网,转载请注明出处!

微信扫一扫打赏
支付宝扫一扫打赏