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 11)
This section uses SUSE Linux Enterprise Server 11 SP4 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:
2832
fa:16:3e:1b:f0:3f
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 2832):
cp -p /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2832
- 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.2832:
vim /etc/sysconfig/network/ifcfg-bond0.2832
Edit the file as follows:
STARTMODE=auto ETHERDEVICE=bond0 LLADDR=fa:16:3e:1b:f0:3f NM_CONTROLLED=no BOOTPROTO=dhcp DEVICE=bond0.2832 USERCONTRL=auto TYPE=Ethernet VLAN_ID=2832
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 2832.
- VLAN_ID: indicates the VLAN ID, such as 2832.
After the modification, press Esc and enter :wq to save the change and exit.
- Run the following command to start the added NIC:
For example, to start bond0.2832, 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.
Delete a NIC
- 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 /sbin/ifdown bond0.vlan command to delete the device.
server7ae352a6-657c-4af5-8058-f3a9ec75ca1f:~ # ip link | grep 2832 7: bond0.2832@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 8888 qdisc noqueue state UP server7ae352a6-657c-4af5-8058-f3a9ec75ca1f:~ # server7ae352a6-657c-4af5-8058-f3a9ec75ca1f:~ # /sbin/ifdown bond0.2832 bond0.2832 server7ae352a6-657c-4af5-8058-f3a9ec75ca1f:~ # - 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 2832):
rm /etc/sysconfig/network/ifcfg-bond0.2832



