Posted: Mon Jun 28, 2021 19:02 Post subject: Simplest command to disable wan interface
What is the simplest command line way of disabling and then reenabling the value `get_wanface`, in my case vlan2 ? Is it just an iptables command or is there something simpler ?
Thanks
Joined: 04 Aug 2018 Posts: 1447 Location: Appalachian mountains, USA
Posted: Tue Jun 29, 2021 14:53 Post subject:
I'm not sure what routers people are on here, but eth0 isn't used the same way in all routers. In the "modern" Marvell/Linksys WRT**** routers, which is my world here (unfortunately), eth0 is the WAN and eth1 covers the LAN ports.
To tweak Wildlion's suggestion just a bit, is this what you are looking for?
ip link set $(get_wanface) down
ip link set $(get_wanface) up
If that $( ) notation is new to you, try the commands with "echo" (and a space) out front just to see what they would do. _________________ 2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.