This section provides sample configurations for a virtual bridge based on the network configuration shown below.
Figure C.6 For setting the IP address to the virtual bridge (br0)
Adding the settings for the virtual bridge
1) Create the settings for the virtual interface.
2) If the virtual interface is activated, deactivate it.
# /opt/FJSVhanet/usr/sbin/stphanet -n sha0 |
3) Create a new virtual interface.
For RHEL8
# /bin/touch /etc/sysconfig/network-scripts/ifcfg-br0 |
For RHEL9
Create br0 with the following parameters by using the "nmcli connection add" command.
connection.id: "br0" connection.interface-name: "br0" connection.type: "bridge" connection.autoconnect: "yes" |
4) Define the IP address and other settings for the virtual bridge.
For RHEL8
Contents of /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0 TYPE=Bridge BOOTPROTO=none IPADDR=192.168.10.10 PREFIX=24 ONBOOT=yes DELAY=0 |
For RHEL9
Set the following parameters to br0 with the "nmcli connection modify" command.
ipv4.method: "manual" ipv4.addresses: "192.168.10.10/24" |
5) Edit the setting for the virtual interface.
For RHEL8
Delete "IPADDR", "PREFIX", and similar statements related to the IP address.
In addition, add the statement of "BRIDGE=br0".
Contents of /etc/sysconfig/network-scripts/ifcfg-sha0
DEVICE=sha0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
BRIDGE=br0 |
For RHEL9
Set the following parameters to sha0 with the "nmcli connection modify" command.
connection.slave-type: "bridge" connection.master: "br0" ipv4.method: "disabled" |
6) Activate the virtual interface.
# /opt/FJSVhanet/usr/sbin/strhanet -n sha0 |
7) Activate the virtual bridge.
For RHEL8
# /usr/sbin/ifup br0 |
For RHEL9
# /usr/bin/nmcli connection up br0 |
Deleting the settings for the virtual bridge
1) Deactivate the virtual bridge.
For RHEL8
# /usr/sbin/ifdown br0 |
For RHEL9
# /usr/bin/nmcli connection down br0 |
2) Deactivate the virtual interface and dismantle the virtual bridge.
# /opt/FJSVhanet/usr/sbin/stphanet -n sha0 |
Note
The following message may be output. This does not disrupt ongoing operation.
hanet: 78011: warning: nmcli failed. (connection down=2560 ifname=virtual interface name) |
3) Delete the virtual bridge.
For RHEL8
# /bin/rm /etc/sysconfig/network-scripts/ifcfg-br0 |
For RHEL9
# nmcli connection delete br0 |
4) Edit the setting for the virtual interface.
For RHEL8
Delete the statement of "BRIDGE=br0".
In addition, add statements of "IPADDR", "PREFIX", and similar statements related to the IP address as necessary.
Contents of /etc/sysconfig/network-scripts/ifcfg-sha0
DEVICE=sha0 IPADDR=192.168.10.10 PREFIX=24 BOOTPROTO=none ONBOOT=yes TYPE=Ethernet |
For RHEL9
Set the following parameters to sha0 with the "nmcli connection modify" command.
connection.slave-type: "" connection.master: "" ipv4.method: "manual" ipv4.addresses: "192.168.10.10/24" |
5) Activate the virtual interface.
# /opt/FJSVhanet/usr/sbin/strhanet -n sha0 |