eth0, eth1 등 인터페이스 순서 정의하기
1. 수정 : /etc/udev/rules.d/70-persistent-net.rules
원하는 인터페이스에 맞추어 다음과 같이 수정한다.# This file was automatically generated by the /lib/udev/write_net_rules # program, run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME= key. # PCI device 0x8086:0x100f (e1000) # PCI device 0x8086:0x100f (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:54:f0:01", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 0x15ad:0x07b0 (vmxnet3) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:54:f0:0b", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" |
2. 수정 /etc/sysconfig/network-scripts/ifcfg-eth[x]
/etc/sysconfig/network-script에 ifcfg-eth0, ifcfg-eth1 등과 같은 파일이 있는데
파일 이름과 내용을 원하는 설정으로 수정한다. device name, mac 등에 유의한다.
[root@localhost network-scripts]# cat ifcfg-eth0 DEVICE=eth0 HWADDR=00:0c:29:54:f0:01 TYPE=Ethernet ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=static IPADDR=10.61.12.2 NETMASK=255.255.0.0 GATEWAY=10.61.0.1 DNS1=168.126.63.1 [root@localhost network-scripts]# cat ifcfg-eth1 DEVICE=eth1 HWADDR=00:0c:29:54:f0:0b TYPE=Ethernet ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=static IPADDR=10.61.12.9 NETMASK=255.255.0.0 GATEWAY=10.61.0.1 #DNS1=168.126.63.1 |
3. reboot을 수행한다.