This section uses SUSE Linux Enterprise Server 11 SP4 as an example to describe how to configure a user-defined VLAN for BMSs.
ip link
Information similar to the following is displayed:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 8888 qdisc mq master bond0 state UP qlen 1000
link/ether fa:16:3e:0d:13:7c brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 8888 qdisc mq master bond0 state UP qlen 1000
link/ether fa:16:3e:0d:13:7c brd ff:ff:ff:ff:ff:ff
4: eth4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 40:7d:0f:f4:ff:5c brd ff:ff:ff:ff:ff:ff
5: eth5: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 40:7d:0f:f4:ff:5d brd ff:ff:ff:ff:ff:ff
6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 8888 qdisc noqueue state UP
link/ether fa:16:3e:0d:13:7c brd ff:ff:ff:ff:ff:ff
Among the devices, eth0 and eth1 bear the VPC, and eth4 and eth5 bear the user-defined VLAN.
ll /etc/udev/rules.d/ | grep 80-persistent-net.rules
cp -p /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/80-persistent-net.rules
Add the NICs and their MAC addresses obtained in step 2, except lo, eth0, eth1, and bond0, to the /etc/udev/rules.d/80-persistent-net.rules file. This ensures that the names and sequence of NICs will not change after the BMS is restarted.
Ensure that NIC MAC addresses and names are lowercase letters.
vim /etc/udev/rules.d/80-persistent-net.rules
The modification result is as follows:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="e8:4d:d0:c8:99:67", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="e8:4d:d0:c8:99:68", NAME="eth1"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="40:7d:0f:f4:ff:5c", NAME="eth4"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="40:7d:0f:f4:ff:5d", NAME="eth5"
After the modification, press Esc, enter :wq, save the configuration, and exit.
cp -p /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond1
cp -p /etc/sysconfig/network/ifcfg-eth0 /etc/sysconfig/network/ifcfg-eth4
cp -p /etc/sysconfig/network/ifcfg-eth0 /etc/sysconfig/network/ifcfg-eth5
Edit the eth4 network configuration file as follows:
STARTMODE=auto MTU=8888 NM_CONTROLLED=no BOOTPROTO=static DEVICE=eth4 USERCONTRL=no LLADDR=40:7d:0f:f4:ff:5c TYPE=Ethernet
Change the value of BOOTPROTO to static, that of DEVICE to eth4, and that of LLADDR to the MAC address of eth4, which you can obtain in step 2. Retain values of other parameters.
Edit the eth5 network configuration file as follows (similar to eth4):
STARTMODE=auto MTU=8888 NM_CONTROLLED=no BOOTPROTO=static DEVICE=eth5 USERCONTRL=no LLADDR=40:7d:0f:f4:ff:5d TYPE=Ethernet
vim /etc/sysconfig/network/ifcfg-bond1
Edit the file as follows:
BONDING_MASTER=yes TYPE=Bond STARTMODE=auto BONDING_MODULE_OPTS="mode=1 miimon=100" NM_CONTROLLED=no BOOTPROTO=static DEVICE=bond1 USERCONTRL=no LLADDR=40:7d:0f:f4:ff:5c BONDING_SLAVE1=eth4 BONDING_SLAVE0=eth5 IPADDR=10.10.10.4 NETMASK=255.255.255.0 MTU=8888
Where,
Retain values of other parameters.
After the modification, press Esc, enter :wq, save the configuration, and exit.
ifup eth4
ifup eth5
ifup bond1

eth4 and eth5 are the network ports bear the user-defined VLAN and bond1 is the port group of the user-defined VLAN.
ip link

ifconfig

