You are not logged in.

#1 2010-07-22 18:06:45

xlin84
Member
From: Russian
Registered: 2010-07-22
Posts: 5

bind to eth1 mac address

Good day. I've got a problem with network interfaces. I have 2 network cards. At a working LAN, to another internet.

eth0 - local
eth1 - internet

The problem is that the network card, change the names of interfaces. For example was eth1, and after restarting became eth0. Because it does not work online because it is bound by the script into eth1. I tried to do through udev. Created a file
/etc/udev/rules.d/70-persistent-net.rules and wrote there lines

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:19:5b:85:e7:f2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:21:91:55:18:e5", ATTR{type}=="1", KERNEL=="wlan*", NAME="eth1"

Confused he does not. What to tell my? The modules of network cards I have now loaded as modules.

02:07.0 Ethernet controller: D-Link System Inc RTL8139 Ethernet (rev 10)
    Subsystem: D-Link System Inc DFE-538TX 10/100 Ethernet Adapter
    Kernel driver in use: 8139too
    Kernel modules: 8139too
02:08.0 Ethernet controller: Intel Corporation 82801DB PRO/100 VE (LOM) Ethernet Controller (rev 82)
    Subsystem: Fujitsu Technology Solutions Device 1001
    Kernel driver in use: e100
    Kernel modules: e100

That's what I was greatly disturbed by all the rules if you delete a file / etc/udev/rules.d/70-persistent-net.rules then restart it should re-create a udev. But! I have such a file was originally!
Sorry for my english .. I take a translator from google

Offline

#2 2010-07-22 18:09:44

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: bind to eth1 mac address

Try this

/etc/rc.conf

# Always load 8139too before e100
MODULES=(8139too e100)

or

/etc/udev/rules.d/10-network.rules

SUBSYSTEM=="net", ATTR{address}=="00:19:5b:85:e7:f2", NAME="eth0"
SUBSYSTEM=="net", ATTR{address}=="00:21:91:55:18:e5", NAME="eth1"

Last edited by karol (2010-07-22 18:19:15)

Offline

#3 2010-07-22 18:19:48

xlin84
Member
From: Russian
Registered: 2010-07-22
Posts: 5

Re: bind to eth1 mac address

The second way I tried did not work. He will double-check but then. But the first method might work, the main load exactly the first module, which for the Internet.

Offline

#4 2010-07-22 18:20:52

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: bind to eth1 mac address

Try the second way again.

/etc/udev/rules.d/10-network.rules

SUBSYSTEM=="net", ATTR{address}=="00:19:5b:85:e7:f2", NAME="eth0"
SUBSYSTEM=="net", ATTR{address}=="00:21:91:55:18:e5", NAME="eth1"

Offline

#5 2010-07-22 18:28:29

xlin84
Member
From: Russian
Registered: 2010-07-22
Posts: 5

Re: bind to eth1 mac address

All right. I'll try the second method again. Thanks!

Offline

#6 2010-07-22 21:53:17

xlin84
Member
From: Russian
Registered: 2010-07-22
Posts: 5

Re: bind to eth1 mac address

Like working. Determined correctly, but I'm not supposed to rejoice ... joint test.

[xlin@saikov ~]$ dmesg | grep eth
8139too 0000:02:07.0: eth0: RealTek RTL8139 at 0xf0a72000, 00:05:5d:34:1d:78, IRQ 18
e100: eth1: e100_probe: addr 0xc2000000, irq 20, MAC addr 00:30:05:42:ac:f2

I created a file /etc/udev/rules.d/70-persistent-net.rules, which is registered in the /lib/udev/write_net_rules variable

RULES_FILE='/etc/udev/rules.d/70-persistent-net.rules'

That with such content

SUBSYSTEM=="net", ATTR{address}=="00:05:5D:34:1D:78", NAME="eth0"
SUBSYSTEM=="net", ATTR{address}=="00:30:05:42:AC:F2", NAME="eth1"

And the appointment of a static IP and gateway for the two network cards, took the file /etc/rc.conf, namely the network daemon.

eth0="eth0 10.28.135.127 netmask 255.255.255.0 broadcast 10.28.135.255"
eth1="eth1 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255"
INTERFACES=(eth0 eth1)
gateway="default gw 10.28.135.254"
ROUTES=(gateway)

[xlin@saikov ~]$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:05:5D:34:1D:78  
          inet addr:10.28.135.127  Bcast:10.28.135.255  Mask:255.255.255.0
          inet6 addr: fe80::205:5dff:fe34:1d78/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1044 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1070 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:413070 (403.3 Kb)  TX bytes:247737 (241.9 Kb)
          Interrupt:18 Base address:0x2000 

eth1      Link encap:Ethernet  HWaddr 00:30:05:42:AC:F2  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::230:5ff:fe42:acf2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:578 (578.0 b)

Offline

#7 2010-07-22 22:07:23

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: bind to eth1 mac address

You need to use lowercase letters: a - not A.

00:05:5d:34:1d:78
00:30:05:42:ac:f2

AC - no
ac - yes

Last edited by karol (2010-07-22 22:07:59)

Offline

#8 2010-07-22 23:22:34

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: bind to eth1 mac address

AFAIK, mac addresses are case insensitive.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#9 2010-07-22 23:26:56

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: bind to eth1 mac address

Inxsible wrote:

AFAIK, mac addresses are case insensitive.

You're right, but:

http://wiki.archlinux.org/index.php/Ude … _Each_Boot
Make sure to use the lower-case hex values in your udev rules. It doesn't like upper-case.

I already troubleshooted at least one case when this was the case <God, what a horrible sentence>.

Last edited by karol (2010-07-22 23:27:12)

Offline

#10 2010-07-23 09:37:40

xlin84
Member
From: Russian
Registered: 2010-07-22
Posts: 5

Re: bind to eth1 mac address

Thank you, like all works.

Last edited by xlin84 (2010-07-23 10:43:27)

Offline

Board footer

Powered by FluxBB