Create a new ifcfg-br0 file:
Device = br0
Type = Bridge
Bootproto = static
Broadcast = 10.1.0000255
Ipaddr = 10.1.29.3
Netmask = 255.255.0.0
Network = 10.1.0.0
Onboot = Yes
Then modify the configuration file of the corresponding Nic, Which is eth1:
# RealTek semiconduco., Ltd. RTL-8169 Gigabit Ethernet
Device = eth1
# Bootproto = none
# Broadcast = 10.1.0000255
Hwaddr = D8: 5D: 4C: 74: EE: E8
# Ipaddr = 10.1.29.3
# Netmask = 255.255.0.0
# Network = 10.1.0.0
Onboot = Yes
# Type = Ethernet
# Userctl = No
# Ipv6init = No
# Peerdns = Yes
Bridge = br0
We can see that the original Nic configuration only retains the device name, hardware address, onboot option, and the newly added bridge = br0.
Then restart the network:
/Etc/init. d/network restart or service network restart
After the gateway is added to br0 in the experiment, the gateway in/etc/sysconfig/network disappears. After the operation is successful, you can use Route-N to view the route and find that all the packets are routed from br0.