Posted: Sat Nov 26, 2022 21:36 Post subject: Configuring WAN connection type via command line question
Greetings to DD-WRT community.
I have non-trivial question about managing WAN connection type via command line.
My case that router uses WAN connection for 2 different type of Internet connection:
1. Auto DHCP
2. Static IP
Let say in Static IP Wan connection 192.168.0.1 is a gateway, Static IP for router is 192.168.0.100 in 192.168.0.0/24 network. Router should provide Internet via this connection to subnet where router itself is a gateway - 192.168.5.0/24.
By default I configured in web interface Auto DHCP case, and it works fine. When switching to Static IP WAN connection, I am running following commands:
After these commands router has connection to Internet with assigned address, but devices in 192.168.5.0/24 subnet do not have it. ip route show seems to be correct:
default via 192.168.0.1 dev eth0
127.0.0.0/8 dev lo scope link
192.168.0.0/24 dev eth0 scope link src 192.168.0.100
192.168.5.0/24 dev br0 scope link src 192.168.5.1
Still searching for info, how to handle this issue via command line. I also tried to play with nvram values, such as:
nvram set wan_ipaddr="192.168.0.100"
nvram set wan_gateway="192.168.0.1"
nvram set wan_proto="static"
and then running above-mentioned commands (kill, kill, ifconfig, route), but it leads to the same result.
Thank you for response. I need to clarify that I do not need 2 WAN's simultaneously, I need ability to switch between them from command line. The only issue that one connection gets parameters automatically via DHCP, and for second one I need to specify it manually. My concern - is it possible to handle this manual settings without committing them to nvram and handle with config files, restarting udhcpc, set route/ip commands via command line?