Cluster 4. Mapping physical interfaces to device names
If you are going to use OvS networking, then skip this article and go to the "Cluster 5" article.
Subnet | VID | NIC | Link 1 | NIC | Link 2 | Bond | Net IP |
---|---|---|---|---|---|---|---|
BCN | 100 | eno1 | bcn_link1 | eno4 | back_link.100 | bcn_bond | 10.10.53.0/24 |
SN | 200 | eno2 | sn_link1 | eno4 | back_link.200 | sn_bond | 10.10.52.0/24 |
IFN | 51 | eno3 | ifn_link1 | eno4 | back_link.51 | ifn_bond | 172.16.51.0/24 |
First we'll disable new NIC naming which comes with CentOS7 by default:
biosdevname=0
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
Lets add MAC addresses to all ifcfg files (on the both nodes):
cd /etc/sysconfig/network-scripts
reboot
After reboot to verify proper naming, execute:
ip link
The last step will be manual test (on both nodes):
This tutorial was used to understand and setup clustering: AN!Cluster
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
Lets add MAC addresses to all ifcfg files (on the both nodes):
cd /etc/sysconfig/network-scripts
for int in $(ls -1 ifcfg-eno* | cut -d'-' -f2);
do
mac=$(ip link show $int | grep ether | awk '{print $2}');
echo "HWADDR=\"$mac\"" >> ifcfg-$int;
done
Now rename device names according to the table above:
mv ifcfg-eno1 ifcfg-bcn_link1
mv ifcfg-eno2 ifcfg-sn_link1
mv ifcfg-eno3 ifcfg-ifn_link1
mv ifcfg-eno4 ifcfg-back_link1
Now change NAME and DEVICE parameters in the appropriate files:
for name in bcn_link1 sn_link1 ifn_link1 back_link:
do
sed -i "s/DEVICE=.*/DEVICE=$name/" ifcfg-$name;
Now we can reboot each node and verify NIC names:echo "HWADDR=\"$mac\"" >> ifcfg-$int;
done
Now rename device names according to the table above:
mv ifcfg-eno1 ifcfg-bcn_link1
mv ifcfg-eno2 ifcfg-sn_link1
mv ifcfg-eno3 ifcfg-ifn_link1
mv ifcfg-eno4 ifcfg-back_link1
Now change NAME and DEVICE parameters in the appropriate files:
for name in bcn_link1 sn_link1 ifn_link1 back_link:
do
sed -i "s/DEVICE=.*/DEVICE=$name/" ifcfg-$name;
sed -i "s/NAME=.*/NAME=$name/" ifcfg-$name;
done
done
reboot
After reboot to verify proper naming, execute:
ip link
The last step will be manual test (on both nodes):
- tail -f -n 0 /var/log/messages # -f means "as file growth" , -n 0 means "initially show no lines"
- then unplug and plug-in cables
- if every cable becomes "Link is down" and then "Link is up", then everything is OK
- backup new configs:
- rsync -av /etc/sysconfig/network-scripts /root/backups
This tutorial was used to understand and setup clustering: AN!Cluster
No comments:
Post a Comment