ubuntu配置静态ip

版权声明:学习中。。。 https://blog.csdn.net/fangdengfu123/article/details/82453692

编辑 /etc/network/interfaces

添加和静态ip有关的参数

iface eth0 inet static
address 192.168.0.10
netmask 255.255.255.0
gateway 192.168.0.1

编辑 /etc/resolv.conf,设置dns

nameserver 202.96.134.133
nameserver 202.106.0.20

执行下面两个命令,启用新设置,如不成功,请重启机器

$sudo ifdown eth0
$sudo ifup eth0

猜你喜欢

转载自blog.csdn.net/fangdengfu123/article/details/82453692