mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-31 18:38:10 +00:00 
			
		
		
		
	WIFI-2059 Handle br-wan/br-lan ip address conflict
Signed-off-by: Rick Sommerville <rick.sommerville@netexperience.com>
This commit is contained in:
		| @@ -0,0 +1,25 @@ | |||||||
|  | #!/bin/sh | ||||||
|  |  | ||||||
|  | [ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0 | ||||||
|  | [ "$INTERFACE" = wan ] || exit 0 | ||||||
|  |  | ||||||
|  | conflict=0 | ||||||
|  | wan_ipaddr="$(ubus call network.interface.wan status | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')" | ||||||
|  | lan_ipaddr="$(ubus call network.interface.lan status | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')" | ||||||
|  | logger -t hotplug "$ACTION of $INTERFACE ($DEVICE) $wan_ipaddr" | ||||||
|  |  | ||||||
|  | [ "$wan_ipaddr" = "192.168.1" ] && [ "$lan_ipaddr" = "192.168.1" ] && { | ||||||
|  |     conflict=1 | ||||||
|  |     dest_ip="192.168.0.1" | ||||||
|  | } | ||||||
|  | [ "$wan_ipaddr" = "192.168.0" ] && [ "$lan_ipaddr" = "192.168.0" ] && { | ||||||
|  |     conflict=1 | ||||||
|  |     dest_ip="192.168.1.1" | ||||||
|  | } | ||||||
|  | [ $conflict = 1 ] && { | ||||||
|  |     logger -t hotplug "IP conflict with br-wan.  Switch br-lan to $dest_ip" | ||||||
|  |     uci set network.lan.ipaddr="$dest_ip" | ||||||
|  |     uci_commit | ||||||
|  |     reload_config | ||||||
|  | } | ||||||
|  | exit 0 | ||||||
| @@ -2,6 +2,8 @@ | |||||||
|  |  | ||||||
| uci set network.wan.type=bridge | uci set network.wan.type=bridge | ||||||
| uci set network.wan6.ifname=@wan | uci set network.wan6.ifname=@wan | ||||||
|  | uci set network.wan.metric=1 | ||||||
|  | uci set network.lan.metric=10 | ||||||
| uci set network.wan.vlan_filtering=1 | uci set network.wan.vlan_filtering=1 | ||||||
| uci set network.lan.vlan_filtering=1 | uci set network.lan.vlan_filtering=1 | ||||||
| exit 0 | exit 0 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Rick Sommerville
					Rick Sommerville