Hi.
I'm sorry, but this option does not always work.
The documentation found the following information:
Using the nameif program
Alternative to the get-mac-address.sh script, you can also use the slightly more convenient nameif program, which is distributed as part of the net-tools package on Debian.
The advantage of nameif is that you can specify the interface names in the / etc / mactab file:
ethmgnt 00: 37: E9: 17: 64: AF
ethwireless 00: 21: E9: 17: 64: B5
It is not possible to rename an interface to a name of an existing interface. So you can not rename eth1 to eth0 as long as eth0 still exists. It is possible to still swap the names eth0 and eth1 by using a temporary name (e.g. first rename eth1 to ethfoo, then eth0 to eth1 and finally ethfoo to eth0). Note that this method may lead to problems if you use common names such as eth0 and eth1. If you upgrade a kernel, the names may be different than you expected, and you may rename a NIC to eth0 while eth0 still exists, leading to name collisions. Therefor, it is recommended to use other names like "ethmgmnt", "ethwired", "ethwireless" and "eth10ge", as shown in the example above.
It turns out that nameif does not work because the names eth0, eth1, eth2 already exist.
The tc-config file:
if [-n "$ AOE"]; then
IFACE = $ (echo $ AOE | awk -F: '{print $ 1}')
DEV = $ (echo $ AOE | awk -F: '{print $ 2}')
ifconfig $ IFACE up
modprobe aoe
echo "$ {BLUE} Waiting for $ DEV $ {NORMAL}"
CNT = 120
until [-e / dev / etherd / interfaces]
do
[$ ((- CNT)) -le 0] && break
echo -ne "$ {RED} $ CNT \ r"
sleep 1
done
printf "% s \ 0" $ IFACE> / dev / etherd / interfaces
echo> / dev / etherd / discover
until [-e / dev / etherd / $ DEV]
do
[$ ((- CNT)) -le 0] && break
echo -ne "$ {RED} $ CNT \ r"
sleep 1
done
if [$ CNT -gt 0]; then
ln -s / dev / etherd / $ DEV / dev / $ DEV
mkdir -p / mnt / $ DEV
mount / dev / $ DEV / mnt / $ DEV> / dev / null 2> & 1
else
echo -ne "\ n $ DEV NOT mounted Press <ENTER>!"; read junk
fi
echo "$ {NORMAL}"
fi
Therefore, in nameif bootlocal.sh not going to work.
Let's try to do so:
First, we give new names to network interfaces.
And then rename as it is necessary to us.
Now bootlocal.sh is:
#! / Bin / sh
# Put other system startup commands here
# give new names to network interfaces.
nameif zeth0 1C: 6F: 65: 59: D1: 65
nameif zeth1 00: 11: 95: F5: 8C: CC
nameif zeth2 00: 10: 5A: E3: 82: 55
#rename as it is necessary to us.
nameif eth0 1C: 6F: 65: 59: D1: 65
nameif eth1 00: 11: 95: F5: 8C: CC
nameif eth2 00: 10: 5A: E3: 82: 55
ifconfig eth0 10.11.8.18 netmask 255.255.255.0 up
ifconfig eth1 192.168.5.237 netmask 255.255.255.0 up
ifconfig eth2 192.168.1.237 netmask 255.255.255.0 up
route add default gw 10.11.8.254
route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.5.250
Nameif now work correctly