Thought I would share this, because there are many of us the need to use specific interface to support specific network traffic. One of the difficulties you have probably encountered is the network device drivers. However, just think about what is going on and you will derive a solution.
Now, when the system boots there is a hardware discovery, coldplug and hotplug processes. After that initiation the drivers start to load. The problem is the order the drivers load and not the driver itself. So, the result is that you might want a PCI NIC card to become eth2 and the on-board to become eth0 and eth1.
I was working with Novell’s SLES 9 SP4 on an IBM x336. After the system booted, I would perform an “ifconfig” command and find the devices not in the order I required, with the PCI network interface always being eth0. I added “ifdown – nameif – ifup” commands to the network init script to no avail. It was like the rc script was not being read. The problem turned out to be with the tg3 (Tiggon) driver.
The solution I came up with was very simple and you might laugh after reading this post.
- I kept my “ifdown – nameif – ifup” scipts intact within the rcnetwok script. You will need to down the interfaces, rename them and bring them back up again.
- Within the /etc/sysconfig/hardware/<device file>, I set the STARTMODE to manual.
- At the start of the /etc/init.d/network script, just after the required start section, I added: /sbin/hwup /etc/sysconfig/hardware/<device file>
What this does it tell the system not to bring the device up. When the network init script runs, it brings the device up. This means there will be not “holds” on the device to your “ifdown – nameif – ifup” section of the network start script will run. You can do this for any device you do not want to come up until the network init script runs.
Hope that helps. Please patronize my sponsors who make this possible. Leave a comment to let everyone know how you solved this problem and if this solution worked for you.
Enjoy!
Tags: eth0 to eth2, ifup nameif ifdown, interface, network, tg3, tiggon