Nic detection order

July 18, 2011 • Customer Services       
Synopsis

If, when you receive your license from us, it refuses to work, it may be because your hardware has selected one NIC to be eth0 and you wanted to use a different one. This article explains what to do to force matters.

Article

Many systems these days are supplied with an on-board NIC. Many people like to use a NIC of their own choosing rather than the one supplied on the motherboard. In addition, the card that is determined to be eth0 (normally the first card detected) forms the HostID that we use to license your CensorNet.

During initial installation of CensorNet onto your system, you are not asked to specify a card detection order, instead, you are given a list of detected cards and asked to select one to specify an IP address for. This may lead you to specify the card you want by name (for example an Intel E1000 Gigabit PCI card) in preference to the onboard Intel E100 card. You do this because you want to make use of the faster speed of the E1000.

Unfortunately, CensorNet will probably deem this card to be eth1 and will configure it as such. If, after installing the CNv4 package, you check the HostID and send it to us, we will send you a license that will simply not work, because the card currently in use is your eth1 card and not the eth0 card the license is expecting.

Fortunately, there are a few easy steps to fix this, so log into your command line as root and follow the instructions below.

At the command line type :-

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

You should see a file that looks something like the following :-

# This file was automatically generated by the /lib/udev/write_net_rules
# program, probably run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# MAC addresses must be written in lowercase.

# PCI device 0x8086:0x1229 (e100)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS=="00:02:a5:3f:7d:35", NAME="eth0"


# PCI device 0x8086:0x2452(e1000)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS=="00:02:a5:4f:de:91", NAME="eth1"

As you can see, the cards are identified by their MAC addresses, so if you want to use both cards, you can just change eth0 and eth1 around. However, for the benefit of this tutorial, we'll assume that you don't want to use the onboard card at all, so we'll modify those last lines so that they read as follows :-

# PCI device 0x8086:0x1229 (e100)
#SUBSYSTEM=="net", DRIVERS=="?*", ATTRS=="00:02:a5:3f:7d:35", NAME="eth0"


# PCI device 0x8086:0x2452(e1000)
SUBSYSTEM=="net", DRIVERS=="?*",ATTRS=="00:02:a5:4f:de:91", NAME="eth0"

As you can see, we've just commented out the e100 card, and told the system that the e1000 card is to be known as eth0.

Press Ctrl-o followed by RETURN to write the file.
Press Ctrl-x to exit the editor and return to the command line.

Now, we need to modify the interfaces file so that it also uses eth0, otherwise, the IP address won't get assigned to your card upon next reboot. Type the following commands :-

cd /etc/network
nano interfaces

You should find a file that looks something like this :-

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface

allow-hotplug eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254

All we need to do is change the two places where eth1 is listed to be eth0 instead, so that our final stanza looks like

:-

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254

Press Ctrl-o followed by RETURN to write the file
Press Ctrl-x to exit the file

Finally, you need to reboot the system. Type

reboot

When the system reboots, you can log into the web interface, go to System->Install License and send the correct HostID to the sales or support teams.

Related articles


Last modified on Mon, July 18, 2011 « Back