본문 바로가기

Linux

[Linux] NIC Port 변경

NIC가 장애가 나서 교체 하게 되는 경우 기존의 NIC정보는 지워지지 않은체 새로운 NIC정보를 가지고 올라오는 경우

 

다음의 경로의 정보값을 수정해주면 NIC포트의 순서를 맞출 수 있다.

 

/etc/udev/rules.d/70-persistent-net.rules

 

 

아래와 같은 정보들이 들어있게 되는데

ifconfig -a 로 정보를 확인 후 예전의 NIC 정보를 지우면 된다. 물론 지움과 동시에 밀린 eth 번호를 수정 가능하다.

수정 후 reboot~

 

ps : 가끔 eth 순서만 맞추느라 신경 못쓸테지만 Mac 주소를 순서대로 활용 하면 순서는 더욱 깔끔해진다. ㅎㅎ

 

# 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 0x14e4:0x1657 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="2c:44:fd:7d:c5:64", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x14e4:0x1657 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="2c:44:fd:7d:c5:65", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x14e4:0x1657 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="2c:44:fd:7d:c5:66", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

# PCI device 0x14e4:0x1657 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="2c:44:fd:7d:c5:67", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

# PCI device 0x8086:0x150e (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="ac:16:2d:95:21:0d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"

# PCI device 0x8086:0x150e (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="ac:16:2d:95:21:0e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"

# PCI device 0x8086:0x150e (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="ac:16:2d:95:21:0c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth6"

# PCI device 0x8086:0x150e (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="ac:16:2d:95:21:0f", ATTR{type}=="1", KERNEL=="eth*", NAME="eth7"
~
~
~