[OpenWrt-Devel] [PATCH v2 5/5] malta: make eth0 the wan interface by default

Yousong Zhou yszhou4tech at gmail.com
Fri Oct 30 23:05:27 EDT 2015


Many packages for OpenWrt currently assume that lan is the "internal"
side of the network map, e.g. if installed, dnsmasq will hand out DHCP
leases on lan, firewall will allow forwarding on lan.

While at it, also configure a lan interface if eth1 exists.

Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
 target/linux/malta/base-files/etc/uci-defaults/02-network |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/target/linux/malta/base-files/etc/uci-defaults/02-network b/target/linux/malta/base-files/etc/uci-defaults/02-network
index e90ecbe..7b3e225 100644
--- a/target/linux/malta/base-files/etc/uci-defaults/02-network
+++ b/target/linux/malta/base-files/etc/uci-defaults/02-network
@@ -3,4 +3,7 @@
 . /lib/functions/uci-defaults.sh
 
 ucidef_set_interface_loopback
-ucidef_set_interface_raw "lan" "eth0" "dhcp"
+ucidef_set_interface_wan "eth0"
+if [ -d "/sys/class/net/eth1" ]; then
+	ucidef_set_interface_lan "eth1"
+fi
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list