본문 바로가기
리눅스

[리눅스] MAC 충돌로 eth0이 안보일 때 해결방법

by 목가 2015. 8. 15.
반응형

1. 일반적인 상태에서 ifconfig

$ ifconfig

eth0      Link encap:Ethernet  HWaddr f4:ce:46:0f:4c:b1
          inet addr:192.168.10.29  Bcast:192.168.255.255  Mask:255.255.0.0
          inet6 addr: fe80::f6ce:46ff:fe0f:4cb1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:374886581 errors:0 dropped:0 overruns:0 frame:9
          TX packets:381551488 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:700781527 (700.7 MB)  TX bytes:478153271 (478.1 MB)
          Interrupt:16

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:548522 errors:0 dropped:0 overruns:0 frame:0
          TX packets:548522 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:38073420 (38.0 MB)  TX bytes:38073420 (38.0 MB)

일반적으로 이렇게 이더넷 장치 정보와 Loopback 정보가 나타나게 되겠죠.
우리에게 가장 흔한 eth0는 잡히면 그냥 아무런 의식없이 이더넷을 사용하게 되는거고 안잡히면 매우 기분 나쁘게 됩니다.
저는 서버를 설정할 때에 아래와 같이 주소를 정적으로 사용합니다.


다들 우분투에서 이더넷 주소를 정적으로 할당하기 위해 아래와 같이 하시죠.

$ vi /etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
    address 192.168.10.10
    netmask 255.255.0.0
    network 192.168.0.0
    broadcast 192.168.255.255
    gateway 192.168.10.1
    dns-nameservers 8.8.8.8

이렇게 하면 우리는 항상 192.168.10.10 이라는 주소로 서버를 구동할 수 있게 되는 것이죠.
그러다가 제가 ARM-Ubuntu 를 이용한 작업을 좀 하다가 맥 주소(MAC)가 충돌나서 부트로더에서 맥을 수정했습니다.

2. eth0 이 안잡힐 때

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

# PCI device 0x1969:0x1063 (ax88796b)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:00", ATTR{dev_id}=="0x0", 
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x1969:0x1063 (ax88796b)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:01", ATTR{dev_id}=="0x0", 
ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x1969:0x1063 (ax88796b)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:02", ATTR{dev_id}=="0x0", 
ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

부트로더에서 맥 주소를 바꿀때마다 기록이 되고있었음...

3. 파일 삭제하면 eth0 다시 보임

문제의 파일을 지워 버립시다.

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

자! 우리가 이 문제의 파일을 지워버리고 부팅을 다시 해 봅시다!!!
성공이에요!!!
다시 eth0 디바이스가 등록되기 시작했습니다.

출처 : http://forum.falinux.com/zbxe/index.php?mid=lecture_tip&page=101&document_srl=532721

반응형

'리눅스' 카테고리의 다른 글

[리눅스] YAFFS2  (0) 2015.08.15
[리눅스] JFFS2  (0) 2015.08.15
[코딩] printf, printk 사용 자제  (0) 2015.08.14
[리눅스 API] 시간  (0) 2015.08.10
[VIM] vim 편집기 윈도우 조절  (0) 2015.08.10

댓글