LINUX6.5 同一网卡多个配置文件时的使用顺序及格式要求
2016-01-05 18:04
656 查看
先写结果:
1.验证ifcfg-eth2与ifcfg-eth2bak这种格式的,service network restart 时会读取这种配置文件
如果改为mv ifcfg-eth2bak ifcfg-eth3.bak,则不会被读取。
2.验证了文件名的使用顺序,两个配置文件对应同一网卡时,以最早使用的配置文件的为准。
##########################################测试过程:
1.验证ifcfg-eth2与ifcfg-eth2bak这种格式的,service network restart 时会读取这种配置文件
如果改为mv ifcfg-eth2bak ifcfg-eth3.bak,则不会被读取。
[root@bys1 network-scripts]# mv ifcfg-eth3 ifcfg-eth3bak
[root@bys1 network-scripts]# mv ifcfg-eth2bak ifcfg-eth2.bak
[root@bys1 network-scripts]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth3bak:
Determining IP information for eth3...^C---改为ifcfg-eth3.bak,不会使用
####################################
2.测试同一网卡,不同配置文件名时的使用顺序及对应IP生效情况
验证了文件名的使用顺序,两个配置文件对应同一网卡时,以最早使用的配置文件的为准。
配置文件情况
--实验2:将IP192.168.11.1对应的配置文件先读取,会使用此配置文件的信息。
1.验证ifcfg-eth2与ifcfg-eth2bak这种格式的,service network restart 时会读取这种配置文件
如果改为mv ifcfg-eth2bak ifcfg-eth3.bak,则不会被读取。
2.验证了文件名的使用顺序,两个配置文件对应同一网卡时,以最早使用的配置文件的为准。
##########################################测试过程:
1.验证ifcfg-eth2与ifcfg-eth2bak这种格式的,service network restart 时会读取这种配置文件
如果改为mv ifcfg-eth2bak ifcfg-eth3.bak,则不会被读取。
[root@bys1 network-scripts]# mv ifcfg-eth3 ifcfg-eth3bak
[root@bys1 network-scripts]# mv ifcfg-eth2bak ifcfg-eth2.bak
[root@bys1 network-scripts]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth3bak:
Determining IP information for eth3...^C---改为ifcfg-eth3.bak,不会使用
[root@bys1 network-scripts]# mv ifcfg-eth3bak ifcfg-eth3.bak [root@bys1 network-scripts]# service network restart Shutting down interface eth0: [ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ]----改回去 ifcfg-eth3bak验证会使用
[root@bys1 network-scripts]# mv ifcfg-eth3.bak ifcfg-eth3bak [root@bys1 network-scripts]# service network restart Shutting down interface eth0: [ OK ] Shutting down interface eth3bak: [ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ] Bringing up interface eth3bak: Determining IP information for eth3...^C
####################################
2.测试同一网卡,不同配置文件名时的使用顺序及对应IP生效情况
验证了文件名的使用顺序,两个配置文件对应同一网卡时,以最早使用的配置文件的为准。
配置文件情况
[root@bys1 network-scripts]# cat ifcfg-eth1 # Intel Corporation 82540EM Gigabit Ethernet Controller DEVICE=eth1 BOOTPROTO=none ONBOOT=yes HWADDR=08:00:27:A0:5F:E7 NETMASK=255.255.255.0 IPADDR=192.168.10.1 [root@bys1 network-scripts]# cat ifcfg-eth1bak # Intel Corporation 82540EM Gigabit Ethernet Controller DEVICE=eth1 BOOTPROTO=none ONBOOT=yes HWADDR=08:00:27:A0:5F:E7 NETMASK=255.255.255.0 IPADDR=192.168.11.1---实验1;将IP192.168.10.1对应的配置文件先读取,后续eth1bak配置文件不会影响。
[root@bys1 network-scripts]# service network restart Shutting down interface eth0: [ OK ] Shutting down interface eth1: [ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ] Bringing up interface eth1: [ OK ] Bringing up interface eth1bak: [ OK ] [root@bys1 network-scripts]# ifconfig eth1 Link encap:Ethernet HWaddr 08:00:27:A0:5F:E7 inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:104 errors:0 dropped:0 overruns:0 frame:0 TX packets:35 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:15754 (15.3 KiB) TX bytes:5698 (5.5 KiB)
--实验2:将IP192.168.11.1对应的配置文件先读取,会使用此配置文件的信息。
[root@bys1 network-scripts]# mv ifcfg-eth1 ifcfg-eth1b [root@bys1 network-scripts]# mv ifcfg-eth1bak ifcfg-eth1a [root@bys1 network-scripts]# service network restart Shutting down interface eth0: [ OK ] Shutting down interface eth1a: [ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ] Bringing up interface eth1a: [ OK ] Bringing up interface eth1b: [ OK ] [root@bys1 network-scripts]# ifconfig eth1 eth1 Link encap:Ethernet HWaddr 08:00:27:A0:5F:E7 inet addr:192.168.11.1 Bcast:192.168.11.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:136 errors:0 dropped:0 overruns:0 frame:0 TX packets:62 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:19100 (18.6 KiB) TX bytes:9287 (9.0 KiB)
相关文章推荐
- linux命令记录
- linux grep基本用法
- linux系统安装完成后需要安装的软件
- RedHat6(CentOS6)下Zabbix2安装
- Linux命令大总结
- USB驱动
- CentOS7配置免密码登陆
- OMSA在Linux服务器上安装部署
- Linux命令之uniq
- Linux源代码分析工具链
- linux学习笔记----1
- Centos7安装haproxy
- Linux GPIO用户空间操作
- 图解linux下top命令的使用
- Linux---YUM
- Linux---LVM补充
- linux ubuntu vim 中文乱码
- linux运维实战练习案例-2015年12月20日-12月31日(第一次)
- Linux命令总结_文件查找之grep
- 首次使用windows管理界面访问安装在UNIX或linux下的DP服务器时提示无权限访问的解决方法