Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com> Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com> Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
14 KiB
Configuring a NIC (SUSE Linux Enterprise Server 12)
This section uses SUSE Linux Enterprise Server 12 SP3 (x86_64) as an example to describe how to configure a NIC added to or deleted from a BMS.
If the network is disconnected after a NIC is added and the BMS is restarted, run the following command:
/usr/sbin/wicked ifup bond0.vlan
vlan indicates the VLAN used by the NIC.
If the network is still disconnected, add the NIC again.
Add a NIC
- Obtain information about the NIC to be added.
Table 1 NIC information Parameter
Description
Example Value
VLAN and MAC address
Specifies the VLAN information and MAC address of the NIC. To obtain them, perform the following operations:
2835
fa:16:3e:01:c3:2e
Gateway
Specifies the gateway address of the NIC. To obtain them, perform the following operations:
192.168.1.1
- Use a key or password to log in to the BMS as user root.
- Run the following command to copy network configuration file /etc/sysconfig/network/ifcfg-bond0 to generate file /etc/sysconfig/network/ifcfg-bond0.vlan (replace vlan with the VLAN obtained in step 1, such as 2835):
cp -p /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2835
- Run the following command to edit /etc/sysconfig/network/ifcfg-bond0.vlan and configure the network configuration file of the newly added NIC, such as ifcfg-bond0.2835:
vim /etc/sysconfig/network/ifcfg-bond0.2835
Edit the file as follows:
STARTMODE=auto ETHERDEVICE=bond0 LLADDR=fa:16:3e:01:c3:2e NM_CONTROLLED=no BOOTPROTO=dhcp DEVICE=bond0.2835 USERCONTRL=auto TYPE=Ethernet VLAN_ID=2835
Where,
- LLADDR: indicates the MAC address of the NIC to be added. For its value, see 1.
- DEVICE: Set it to bond0.vlan. vlan is the value obtained from 1, such as 2835.
- VLAN_ID: indicates the VLAN ID, such as 2835.
After the modification, press Esc and enter :wq to save the change and exit.
- Run the following command to start the added NIC:
/usr/sbin/wicked ifup bond0.vlan
For example, to start bond0.2835, run the command shown in the following figure.
- Run the following command to check the status of the NIC device:
- Ping the gateway from the new network device to check whether the network connectivity is normal.
Use the gateway address obtained from 1.
Deleting NICs
- Obtain the VLAN and MAC address of the NIC to be deleted.
- Use a key or password to log in to the BMS as user root.
- Locate the network device based on the VLAN information and run the /usr/sbin/wicked ifdown bond0.vlan command to delete the device.
serverc7fc560e-24d6-4ad4-9b1e-567a762532c3:~ # ip link | grep 2835 12: bond0.2835@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 8888 qdisc noqueue state UP mode DEFAULT group default qlen 1000 serverc7fc560e-24d6-4ad4-9b1e-567a762532c3:~ # serverc7fc560e-24d6-4ad4-9b1e-567a762532c3:~ # /usr/sbin/wicked ifdown bond0.2835 serverc7fc560e-24d6-4ad4-9b1e-567a762532c3:~ #
- Run the following command to delete network configuration file /etc/sysconfig/network/ifcfg-bond0.vlan (replace vlan with the VLAN obtained from 1, such as 2835):
rm /etc/sysconfig/network/ifcfg-bond0.2835
- Run the following command to delete network configuration file /etc/wicked/ifconfig/bond0.vlan.xml (replace vlan with the VLAN obtained from 1, such as 2835):
rm /etc/wicked/ifconfig/bond0.2835.xml



