initscripts icon indicating copy to clipboard operation
initscripts copied to clipboard

Consult about route contention

Open gaoxingwang opened this issue 2 years ago • 0 comments

When I use the following configuration, restart the network service.

Configuration content: /etc/sysconfig/network-scripts/ifcfg-eth2

STARTMODE='onboot'
BOOTPROTO='static'
IPADDR='192.9.201.21'
NETMASK='255.255.0.0'
MTU='1450'
DEVICE="eth2"

/etc/sysconfig/network-scripts/route-eth2

ADDRESS0=192.9.0.0
NETMASK0=255.255.0.0
GATEWAY0=192.9.201.200

ADDRESS1=10.10.1.0
NETMASK1=255.255.255.0
GATEWAY1=192.9.201.200

ADDRESS2=12.10.110.0
NETMASK2=255.255.255.0
GATEWAY2=192.9.201.200

Before the commit a71dcfd392cc1022c2 , routes corresponding to gateway 1 and gateway 2 can be added, but the route corresponding to gateway 0 fails to be added, and error message like :"RTNETLINK answers: File exists".

After the patch is merged, the route corresponding to gateway0 can replace the default route added by the kernel. As a result, the other two routes cannot be added, and the error message is displayed: Error: Nexthop has invalid gateway.

The patch aims to solve the race problem between routes and works successfully.But the failure to add gateway1 and gateway2 directly affects my network. In this case, users should not use the configuration like this? Or do we have a better solution?

gaoxingwang avatar Jun 19 '23 11:06 gaoxingwang