首 页 行业热点 新车 试驾评测 养车用车 车型库

iface eth0 inet manual与iface eth0 inet static有什么区别

发布网友

我来回答

2个回答

热心网友

这样给你解释你看看 eth0上IP为自动获取

eth1上为手工设置(又是VPC自己要求的)

配置过程:

1、打开Ubuntu的/etc/network/interfaces文件 。默认内容如下:

auto lo
iface lo inet loopback

2、eth0为自动获取IP,所以不需要配置了。插入要手工设置IP的eth1的IP信息,编辑后内容如下,前面auto eth1,让网卡开机自动挂载.:

auto lo
iface lo inet loopback
auto eth1
iface eth1 inet static
address 192.168.0.101
netmask 255.255.255.0
network 192.168.0.0
broadcask 192.168.0.255
gateway 192.168.0.2

3、编写完毕保存,然后打开终端运行如下命令,重新启动网卡即可:

$ /etc/init.d/networking restart

也可以重启网卡让新配置生效,优点是不影响其他网络接口:

$ sudo ifdown eth0

$ sudo ifup eth04、如果以DHCP方式配置网卡,则改为:
auto eth0
iface eth0 inet dhcp

也可以在命令行下直接输入下面的命令来获取地址
sudo dhclient eth0

5、配置DNS服务器的地址,最多可以使用3个DNS服务器

$ sudo vi /etc/resolv.conf

nameserver 202.96.134.133
nameserver 202.96.128.68
nameserver 202.96.128.166

对"resolv.conf"的修改是即时生效的。可以使用nslookup命令进行DNS服务器查询,以验证"resolv.conf"配置文件。

如何查看DNS

$ less /etc/resolv.conf

热心网友

虽然没太看懂老外的回答,但还是来这做一下搬运工吧。

iface eth0 inet static: Defines a static IP address for eth0

iface eth0 inet manual :To create a network interface without an IP address at all. Usually used by interfaces that are bridge or aggregation members, or have a VLAN device configured on them

参考地址

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com