rocky 9 버전에서 nic 이름이 순서대로 아니고 랜덤으로 올라오는 경우가 있다
이럴때 강제적으로 변경하는 방법
1. ip link 으로 현재 nic의 맥어드레스를 확인하자
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: ens2f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether 00:1b:21:d2:32:30 brd ff:ff:ff:ff:ff:ff altname enp9s0f0 3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether 48:df:37:28:3f:94 brd ff:ff:ff:ff:ff:ff altname enp3s0f0 4: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000 link/ether 00:1b:21:d2:32:31 brd ff:ff:ff:ff:ff:ff 5: eth3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000 link/ether 00:1b:21:d2:32:34 brd ff:ff:ff:ff:ff:ff 6: ens2f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000 link/ether 00:1b:21:d2:32:35 brd ff:ff:ff:ff:ff:ff altname enp10s0f1 7: eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000 link/ether 48:df:37:28:3f:95 brd ff:ff:ff:ff:ff:ff altname enp3s0f1 |
2. 위에서 확인한 mac 정보를 가지고 룰 파일을 생성
1 2 3 4 5 6 7 8 |
[root@computer1 system-connections]# vi /etc/udev/rules.d/70-persistent-net.rules SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="48:df:37:28:3f:94", NAME="eno1" SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="48:df:37:28:3f:95", NAME="eno2" SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:1b:21:d2:32:30", NAME="eth1" SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:1b:21:d2:32:31", NAME="eth2" SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:1b:21:d2:32:34", NAME="eth3" SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:1b:21:d2:32:35", NAME="eth4" |
3. 적용
1 2 |
[root@computer1 system-connections]# udevadm control --reload [root@computer1 system-connections]# udevadm trigger |
4. 리부팅
1 |
[root@computer1 system-connections]# init 6 |
5. 리부팅 후 확인
1 2 3 4 5 6 7 8 9 10 |
[root@computer1 ~]# cat /proc/net/dev Inter-| Receive | Transmit face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed lo: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 eth1: 1004984 15835 0 0 0 0 0 0 531487 3123 0 0 0 0 0 0 eno1: 115914 1390 0 478 0 0 0 514 78831 764 0 0 0 0 0 0 eth2: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 eth3: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 eth4: 362024 5962 0 0 0 0 0 0 9356 56 0 0 0 0 0 0 eno2: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |