Using Lede to do soft routing on online.net ,Network configuration problem

https://documentation.online.net/en/dedicated-server/network/ip-failover/virtual-machine?s[]=esxi

Now, I have been able to connect to the network properly by document configuration

This is my configuration

config interface 'wan'
	option ifname 'eth0'
	option proto 'static'
	option ipaddr '212.xx.34.xxx'
	option netmask '255.255.255.255'
	option gateway '62.210.0.1'
	option macaddr '00:50:56:xx:48:xx'

But each time I modify the interface, I need to manually execute the two commands

route add 62.210.0.1 dev eth0
route add default gw 62.210.0.1 dev eth0

Are there any other configuration methods that can avoid adding route manually every time the interface is modified?

If your netmask is '255.255.255.255', then only your device can exists on the WAN network, and even the gateway router at '62.210.0.1' is unreachable; I would bet that netmask is wrong.

No, this is correct, because I'm using this configuration and can guarantee normal connections

Just when I modify the interface, route will be reset
I need to manually execute the following command to connect to the network properly
route add 62.210.0.1 dev eth0
route add default gw 62.210.0.1 dev eth0

I am only saying that not being able to reach the gateway is the consequence of it being outside the defined network. If you insists in that configuration, I would try to add a "config 'route'" section, so it gets redefined each time the interface restarts.

Can you give an example?
In the morning, my friend used this method of configuration, but he failed
The above route statement is modified by the CentOS document of online.net
In fact, I don't understand its function

OK, let's see...

  • "route add 62.210.0.1 dev eth0" means: "host 62.210.0.1 can be found on eth0".
  • "route add default gw 62.210.0.1 dev eth0" means "all non-local traffic must be sent to host 62.210.0.1 using eth0".

Considering that you already configured 62.210.0.1 as the default gateway on your network config file, the second command seems redundant (and since you are also specifying the network device where 62.210.0.1 can be found, it also makes redundant the first command). To add that route in LEDE, I would add just these lines to the network config file:

config 'route' 'gateway_route'
    option 'interface' 'wan'
    option 'target' '62.210.0.1'

If that does not work, execute "ifconfig" then "route", and post the results here.

1 Like

Thanks very much
He's already working

1 Like