[LEDE-DEV] [PATCH] BT Home Hub 5A: configure Red Ethernet as DMZ interface (FS#490) and fix Red Ethernet switch port (FS#390)

Mauro M. openwrt at ezplanet.net
Sat Feb 11 09:55:20 PST 2017


This proposed patch applies to BT Home Hub 5 Type A and:

1) it includes configuration for the Red Ethernet port as an additional 
"dmz" interface (feature request FS#490)
2) it fixes FS#390 providing the ability to associate port 5 to the main 
switch VLAN.

Signed-off-by: Mauro Mozzarelli <openwrt at ezplanet.net>
---

diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
b/package/base-files/files/lib/functions/uci-defaults.sh
index f4c1d96..b6dd1f6 100755
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -71,6 +71,12 @@ ucidef_set_interface_lan() {
      json_select ..
  }

+ucidef_set_interface_dmz() {
+    json_select_object network
+    _ucidef_set_interface dmz "$@"
+    json_select ..
+}
+
  ucidef_set_interface_wan() {
      json_select_object network
      _ucidef_set_interface wan "$@"
diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network 
b/target/linux/lantiq/base-files/etc/board.d/02_network
index bc61a73..00279d5 100755
--- a/target/linux/lantiq/base-files/etc/board.d/02_network
+++ b/target/linux/lantiq/base-files/etc/board.d/02_network
@@ -15,6 +15,7 @@ annex="a"
  encaps="llc"
  payload="bridged"
  lan_mac=""
+dmz_mac=""
  wan_mac=""
  interface_wan=""

@@ -77,8 +78,10 @@ BTHOMEHUBV3A)
  BTHOMEHUBV5A)
      lan_mac=$(mtd_get_mac_binary_ubi caldata 4364)
      wan_mac=$(macaddr_add "$lan_mac" 1)
+    dmz_mac=$(macaddr_add "$wan_mac" 3)
      ucidef_add_switch "switch0" \
-        "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t at eth0"
+        "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "5:dmz" "6t at eth0"
+    ucidef_set_interface_dmz "eth0.2"
      ;;

  DGN3500*)
@@ -180,6 +183,7 @@ ucidef_set_interface_wan "$interface_wan" "pppoe"

  [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
  [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
+[ -n "$dmz_mac" ] && ucidef_set_interface_macaddr "dmz" "$dmz_mac"

  board_config_flush

diff --git a/target/linux/lantiq/dts/BTHOMEHUBV5A.dts 
b/target/linux/lantiq/dts/BTHOMEHUBV5A.dts
index 7f19e52..59b6cee 100644
--- a/target/linux/lantiq/dts/BTHOMEHUBV5A.dts
+++ b/target/linux/lantiq/dts/BTHOMEHUBV5A.dts
@@ -244,15 +244,6 @@
              phy-mode = "gmii";
              phy-handle = <&phy13>;
          };
-    };
-
-    wan: interface at 1 {
-        compatible = "lantiq,xrx200-pdi";
-        #address-cells = <1>;
-        #size-cells = <0>;
-        reg = <1>;
-        lantiq,wan;
-
          ethernet at 5 {
              compatible = "lantiq,xrx200-pdi-port";
              reg = <5>;




More information about the Lede-dev mailing list