HercMull Posted August 10, 2016 Posted August 10, 2016 I have my NANO successfully configured to use both a USB Wi-Fi dongle (wlan2) and a USB Ethernet adapter (eth1), however I would like to create a interface definition in /etc/config/network that would allow both to share configuration parameters (and, by extension, firewall rules). The OpenWRT Wiki provides some guidance for configuring multiple network settings for a single physical device but I can't seem to work out how to do the opposite: single network/ firewall configuration regardless of which physical device is connected to the USB port. Of course, it's possible to duplicate the configuration for each interface, but the simplicity/ consistency of a single setup for whichever "WAN" interface happens to be connected is preferable. Any thoughts? Quote
BeNe Posted August 10, 2016 Posted August 10, 2016 What "parameters" do you mean ? Quote allow both to share configuration parameters Like a Loadbalancer for a WAN Interface ? Quote configuring multiple network settings for a single physical Sorry but i´m confused what you exactly mean.... Quote
Foxtrot Posted August 10, 2016 Posted August 10, 2016 Perhaps you would like to create a bridge interface? https://wiki.openwrt.org/doc/networking/network.interfaces Quote
HercMull Posted August 10, 2016 Author Posted August 10, 2016 Not looking to create a bridge, insofar as only one of the interfaces in question will ever be connected at a time. /etc/config/wireless contains: config wifi-iface option device 'radio2' option ifname 'wlan2' option mode 'sta' option network 'wan' Which associates the wlan2 interface w/ the WAN config block in /etc/config/network: config interface 'wan' option proto 'dhcp' option dns '8.8.8.8, 8.8.4.4' And, perhaps more importantly, w/ the WAN zone of the firewall and its related rules. In a perfect world, I would like to have the WAN settings from /etc/config/network and /etc/config/firewall applied to both the USB WLAN interface or the USB Ethernet, regardless of which is connected. However, if I add option ifname 'eth1' to the config interface 'wan' section /etc/config/network, those settings will no longer be applied to the WLAN interface. The ultimate goal is to have a single config block in /etc/config/network and /etc/config/network cover the settings for both interfaces. Quote
HercMull Posted August 10, 2016 Author Posted August 10, 2016 Upon closer inspection, it appears that /etc/config/firewall allows for multiple networks to be added to a zone: config zone option name wan list network 'wan' list network 'wan2' option input ACCEPT option output ACCEPT option forward ACCEPT option masq 1 option mtu_fix 1 I mistakenly thought that the zone name was directly linked to the logical network name and, therefore, a new interface would require creation of a new zone. Glad to be wrong about that. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.