Using Lede to do soft routing on ,Network configuration problem[]=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 ''
	option netmask ''
	option gateway ''
	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 dev eth0
route add default gw dev eth0

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

If your netmask is '', then only your device can exists on the WAN network, and even the gateway router at '' 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 dev eth0
route add default gw 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
In fact, I don't understand its function

OK, let's see...

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

Considering that you already configured as the default gateway on your network config file, the second command seems redundant (and since you are also specifying the network device where 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' ''

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