[OpenWrt-Devel] [PATCH 5/5] malta: use "static" proto for lan interface

Florian Fainelli florian at openwrt.org
Wed Oct 28 12:19:04 EDT 2015


On Oct 28, 2015 5:56 AM, "Yousong Zhou" <yszhou4tech at gmail.com> wrote:
>
> This is almost the default config of OpenWrt targets (currently even
> those sunxi boards with only one ethernet interface use static IP
> address for its lan interface).

And this is intend intended, because Malta is primarily used under qemu,
from which you get your network to be NAT'd or bridged from/with the host.
Your change would force an user to reconfigure the network on boot, and
that seems like a less sensible default to me.

>
> While at it, also configure a wan 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..1b22ec5 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_lan "eth0"
> +if [ -d "/sys/class/net/eth1" ]; then
> +       ucidef_set_interface_wan "eth1"
> +fi
> --
> 1.7.10.4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20151028/46edbd51/attachment.htm>
-------------- next part --------------
_______________________________________________
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