Difference between revisions of "Binding Network Devices"

From Amahi Wiki
Jump to: navigation, search
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{MessageBox|
 +
backgroundcolor = #faa|
 +
image =Warning.png|
 +
heading =WARNING|
 +
message = This is recommended only for advanced users, proceed with caution.}}
 +
 +
= Step 1 =
 +
 
You can manually force the assignment from a network card to what device comes up as (eth0, eth1 ...), by changing the udev rules. You can manually edit this file:
 
You can manually force the assignment from a network card to what device comes up as (eth0, eth1 ...), by changing the udev rules. You can manually edit this file:
  
Line 5: Line 13:
 
This file maps MAC address to device name.
 
This file maps MAC address to device name.
  
=Example=
+
'''Example'''
 
<small>
 
<small>
 
  SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1d:60:b5:43:66", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
 
  SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1d:60:b5:43:66", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Line 15: Line 23:
 
If you want to reverse the assignments, switch eth0 and eth1 at the end of the entries. Or delete one of the entries.
 
If you want to reverse the assignments, switch eth0 and eth1 at the end of the entries. Or delete one of the entries.
  
 +
= Step 2 =
  
If yo still do not have network functionality (system my boot complaining about a MAC mismatch on eth0) you may need to edit this file:
+
You may need to also edit this configuration file as well:
  
 
             /etc/sysconfig/network-scripts/ifcfg-eth0
 
             /etc/sysconfig/network-scripts/ifcfg-eth0
  
=Example=
+
if it has the MAC address for the device in it (e.g. in a variable called HWADDR).
<small>
+
 
HWADDR=00:1d:60:b5:43:66
+
'''Example'''
</small>
 
  
You will need to adjust the HWADDR to match the MAC address of the card you wish to make eth0.  Note: if you wish to keep eth1 active, you will also have to edit ifcfg-ith1 as well.
+
            HWADDR=00:1d:60:b5:43:66
  
 +
You will need to adjust the HWADDR to match the MAC address of the card you wish to make eth0.  Note: if you wish to keep eth1 active, you may also have to edit ifcfg-ith1 as well.
  
These changes will only take effect after a reboot.
+
These changes will only take effect after a reboot or a restart of the network services.
  
'''Please exercise care. Improperly modifying these file may render your system without network or even not boot properly.'''
+
'''Please exercise care. Improperly modifying these files may render your system without network or even not boot properly.'''

Latest revision as of 03:54, 17 August 2012

Warning.png WARNING
This is recommended only for advanced users, proceed with caution.



Step 1

You can manually force the assignment from a network card to what device comes up as (eth0, eth1 ...), by changing the udev rules. You can manually edit this file:

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

This file maps MAC address to device name.

Example

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1d:60:b5:43:66", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="5c:d9:98:af:21:43", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="et1"

This file maps the card with MAC 00:1d:60:b5:43:66 to eth0 and the card with 5c:d9:98:af:21:43 to eth1.

If you want to reverse the assignments, switch eth0 and eth1 at the end of the entries. Or delete one of the entries.

Step 2

You may need to also edit this configuration file as well:

           /etc/sysconfig/network-scripts/ifcfg-eth0

if it has the MAC address for the device in it (e.g. in a variable called HWADDR).

Example

           HWADDR=00:1d:60:b5:43:66

You will need to adjust the HWADDR to match the MAC address of the card you wish to make eth0. Note: if you wish to keep eth1 active, you may also have to edit ifcfg-ith1 as well.

These changes will only take effect after a reboot or a restart of the network services.

Please exercise care. Improperly modifying these files may render your system without network or even not boot properly.