[OpenWrt-Devel] [PATCH] ramips: fix port setup for Ubiquiti EdgeRouter X (and SFP)
Matthias Schiffer
mschiffer at universe-factory.net
Mon Dec 16 15:25:13 EST 2019
On 12/16/19 1:31 PM, Adrian Schmutzler wrote:
> The EdgeRouter only has LAN ports labelled eth0 to eth4 (plus
> unsupported eth5 for SFP version). Thus, there is no reason to set
> up one of them as WAN.
>
> This patch sets all ports to "lan" and removes the unused wan_mac.
>
> Actually, stock firmware on the EdgeRouter X assigns a specific MAC
> address to each port:
>
> eth0 *:f4 (label)
> eth1 *:f5
> eth2 *:f6
> eth3 *:f7
> eth4 *:f8
> switch0 *:f9
>
> (No data for SFP version)
>
> Only the label MAC is stored on flash in factory 0x22.
>
> OpenWrt currently sets ðernet to this address, so all ports will
> use that one in OpenWrt.
>
> Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
Having a WAN port by default is extremely useful (and necessary for easy
automatic configuration by OpenWrt-based frameworks like Gluon without
having to special-case many devices).
I would prefer if we could always make one port WAN as long as we have at
least two independently configurable ports, regardless of labeling - at
least that was my policy for creating new hardware support in the past.
Regards,
Matthias
> ---
> .../ramips/mt7621/base-files/etc/board.d/02_network | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
> index 5c6b5659cb..6dfe24e296 100755
> --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
> @@ -62,8 +62,6 @@ ramips_setup_interfaces()
> asus,rt-ac85p|\
> iptime,a6ns-m|\
> mikrotik,rb750gr3|\
> - ubiquiti,edgerouterx|\
> - ubiquiti,edgerouterx-sfp|\
> youhua,wr1200js)
> ucidef_add_switch "switch0" \
> "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6 at eth0"
> @@ -124,6 +122,11 @@ ramips_setup_interfaces()
> ucidef_add_switch "switch0" \
> "0:lan" "6 at eth0"
> ;;
> + ubiquiti,edgerouterx|\
> + ubiquiti,edgerouterx-sfp)
> + ucidef_add_switch "switch0" \
> + "0:lan" "1:lan" "2:lan" "3:lan" "4:lan" "6 at eth0"
> + ;;
> xiaomi,mir3g)
> ucidef_add_switch "switch0" \
> "2:lan:2" "3:lan:1" "1:wan" "6t at eth0"
> @@ -246,10 +249,6 @@ ramips_setup_macs()
> telco-electronics,x1)
> wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xe006)" 1)
> ;;
> - ubiquiti,edgerouterx|\
> - ubiquiti,edgerouterx-sfp)
> - wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x22)" 1)
> - ;;
> wevo,11acnas|\
> wevo,w2914ns-v2|\
> zio,freezio)
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20191216/2eeaed8f/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list