WAN port on router acts as LAN

Hello Team, I have a ZBT WE-826 and I realized that anytime I connect an external wired internet via WAN port, the ZBT WE-826 router IP address changes to that of the internet source. It makes the ZBT WE-826 router act as an extender.

Please I think I am missing something in my settings.

Thank you

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have

ubus call system board; \
uci export network; \
ip -4 addr
2 Likes

Here is the output

#############################################
####### ubus call system board; ##########
#########################################

{
	"kernel": "4.14.180",
	"hostname": "OpenWrt",
	"system": "MediaTek MT7620A ver:2 eco:6",
	"model": "HL-WR830-4G",
	"board_name": "zbtlink,zbt-we826-16m",
	"release": {
		"distribution": "OpenWrt",
		"version": "19.07.3",
		"revision": "r11063-85e04e9f46",
		"target": "ramips/mt7620",
		"description": "OpenWrt 19.07.3 r11063-85e04e9f46"
	}
}

 
##################################################
########## uci export network; ##############
###################################
package network

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd4a:226f:5b58::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0.1'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.4.4'

config device 'lan_dev'
	option name 'eth0.1'

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'dhcp'

config device 'wan_dev'
	option name 'eth0.2'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto '3g'
	option device '/dev/ttyUSB2'
	option ipv6 'auto'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '1 2 3 4 6t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '0 6t'

########################################################
#######	ip -4 addr #######################################
################################################
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
42: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    inet 192.168.4.4/24 brd 192.168.4.255 scope global br-lan
       valid_lft forever preferred_lft forever```

The wan port is configured for dhcp. So when you connect it to an upstream router it will acquire IP and other settings from the dhcp server of the other router. What are you trying to achieve there?

1 Like

We want the WAN port to be able to receive internet access from a wired internet that is connected to it. What happens now is that when we connect a wired internet, the router no longer works as a router, it works as a range extender and it gets the IP address from the internet source. We do not want this. we want the router to still maintain its original IP address and act as a router.

I think you have confused something. Let me explain.

This is what happens now.

The router works as a router. It routes packets between 2 different networks, the wan and the lan. What you describe as range extender would work if wan and lan interfaces were bridged to appear as one interface, more like a switch.

By original IP I believe you mean the 192.168.4.4 that lan has? Then the only solution is to make the router a dumbAP.
This way all the ports will belong to the lan, the router will be acting as a switch and there will be only one IP on the lan interface.

I guess I am not explaining this quite correctly. Let me make another attempt.

What is happening right now is that it seems the LAN and WAN interfaces are bridged so when you connect a wired internet to WAN, you will realize that the original IP address of the router changes from 192.168.4.4 to say 192.168.0.2(IP of the wired connection). This is what is happening right now and we don't want that. We want the WAN to work separately from the LAN.

When the WAN is connected

What is the output of

ip addr

And

ip route

We can't even ssh into the router when WAN is connected because the IP of the router has been changed by the wired internet source. So I can't get that information unfortunately

That is not evident from the configuration.
LAN has 4.4 and WAN is set to dhcp, so it will get whatever the upstream router gives by dhcp.
LAN is bound to eth0.1 and WAN to eth0.2, so they are separated.
In any case the IP of the router doesn't change, but another one is added. So the router will have both 4.4 on the LAN and 0.2 on the WAN. You will however have problem if WAN network is also 192.168.4.0/24.

1 Like

You are very correct. The IP of the WAN is 192.168.0.1 range. There is no conflict. So why does the WAN IP always appear when you make connections over the LAN? It seems to be blocking out the LAN IP and taking precedence.

This is really puzzling

Check if the network mask of 192.168.0.X is the usual /24 (a.k.a 255.255.255.0) or something else which might create an overlap.

2 Likes

Post the output:

swconfig list; swconfig dev switch0 show; \
brctl show; ip address show; ip route show
2 Likes

Here is the output

###########################
#############swconfig list;#############
##################################
Found: switch0 - mt7620

###########################
############swconfig dev switch0 show;#########
#############################################
Global attributes:
	enable_vlan: 1
	mib: Switch MIB counters
PPE_AC_BCNT0: 0
PPE_AC_PCNT0: 0
PPE_AC_BCNT63: 0
PPE_AC_PCNT63: 0
PPE_MTR_CNT0: 0
PPE_MTR_CNT63: 0
GDM1_TX_GBCNT: 0
GDM1_TX_GPCNT: 0
GDM1_TX_SKIPCNT: 0
GDM1_TX_COLCNT: 0
GDM1_RX_GBCNT1: 0
GDM1_RX_GPCNT1: 0
GDM1_RX_OERCNT: 0
GDM1_RX_FERCNT: 0
GDM1_RX_SERCNT: 0
GDM1_RX_LERCNT: 0
GDM1_RX_CERCNT: 0
GDM1_RX_FCCNT: 0
GDM2_TX_GBCNT: 0
GDM2_TX_GPCNT: 0
GDM2_TX_SKIPCNT: 0
GDM2_TX_COLCNT: 0
GDM2_RX_GBCNT: 0
GDM2_RX_GPCNT: 0
GDM2_RX_OERCNT: 0
GDM2_RX_FERCNT: 0
GDM2_RX_SERCNT: 0
GDM2_RX_LERCNT: 3
GDM2_RX_CERCNT: 0
GDM2_RX_FCCNT: 0

Port 0:
	mib: Port 0 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 2
	link: port:0 link:down
Port 1:
	mib: Port 1 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 1
	link: port:1 link:down
Port 2:
	mib: Port 2 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 1
	link: port:2 link:down
Port 3:
	mib: Port 3 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 1
	link: port:3 link:down
Port 4:
	mib: Port 4 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 1
	link: port:4 link:down
Port 5:
	mib: Port 5 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 0
	link: port:5 link:down
Port 6:
	mib: Port 6 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 584
RxBOC      : 0
RxGOC      : 162790
RxEPC1     : 0
RxEPC2     : 584

	pvid: 0
	link: port:6 link:up speed:1000baseT full-duplex 
Port 7:
	mib: Port 7 MIB counters
TxGPC      : 0
TxBOC      : 0
TxGOC      : 0
TxEPC      : 0
RxGPC      : 0
RxBOC      : 0
RxGOC      : 0
RxEPC1     : 0
RxEPC2     : 0

	pvid: 0
	link: port:7 link:down
VLAN 1:
	vid: 1
	ports: 1 2 3 4 6t 
VLAN 2:
	vid: 2
	ports: 0 6t

#########################################
########brctl show;######################
#########################################
bridge name	bridge id		STP enabled	interfaces
br-lan		7fff.90505a57ae88	no		eth0.1
							wlan0
bridge name	bridge id		STP enabled	interfaces
br-lan		7fff.90505a57ae88	no		eth0.1
							wlan0

####################################################
##############ip address show;#####################
###################################################
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
    link/ether 90:50:5a:57:ae:88 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::9250:5aff:fe57:ae88/64 scope link 
       valid_lft forever preferred_lft forever
3: ifb0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN qlen 32
    link/ether 06:61:cc:20:dd:89 brd ff:ff:ff:ff:ff:ff
4: ifb1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN qlen 32
    link/ether 52:99:78:b4:81:16 brd ff:ff:ff:ff:ff:ff
5: wwan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether b2:9f:1f:d9:e2:27 brd ff:ff:ff:ff:ff:ff
9: eth0.2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 90:50:5a:57:ae:88 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::9250:5aff:fe57:ae88/64 scope link 
       valid_lft forever preferred_lft forever
11: 3g-wan6: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 3
    link/ppp 
    inet 10.191.143.234 peer 10.64.64.64/32 scope global 3g-wan6
       valid_lft forever preferred_lft forever
24: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 90:50:5a:57:ae:88 brd ff:ff:ff:ff:ff:ff
    inet 192.168.4.4/24 brd 192.168.4.255 scope global br-lan
       valid_lft forever preferred_lft forever
    inet6 fd4a:226f:5b58::1/60 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::9250:5aff:fe57:ae88/64 scope link 
       valid_lft forever preferred_lft forever
25: eth0.1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether 90:50:5a:57:ae:88 brd ff:ff:ff:ff:ff:ff
26: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br-lan state UP qlen 1000
    link/ether 90:50:5a:57:ae:88 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::9250:5aff:fe57:ae88/64 scope link 
       valid_lft forever preferred_lft forever

################################################
###########ip route show ########################
################################################
default via 10.64.64.64 dev 3g-wan6 
10.64.64.64 dev 3g-wan6 scope link  src 10.191.143.234 
192.168.4.0/24 dev br-lan scope link  src 192.168.4.4 

1 Like

Nothing strange here. Your router has 2 IPs, one in the lan and one from the 3g/lte network. The 3g/lte interface was not available earlier.
If you connect the wan port, most likely the default route from wan will take precedence, so all traffic will be diverted there.
Verify that the wan subnet is not the same as the 192.168.4.0 you have in lan.

1 Like

If the issue persists, connect the WAN and repeat the diagnostics.
No need to run commands separately, you can copy-paste the whole code block.

Verify that the wan subnet is not the same as the 192.168.4.0 you have in lan.

How do i verify this?

ip route show | grep " src " | cut -d " " -f 3,1

Connect your PC on the internet line and verify the IP/MASK/Gateway it is acquiring from DHCP.

1 Like

Here is the output

###########################################################
###############   ip route show | grep " src " | cut -d " " -f 3,1  ####
######################################################################

10.64.64.64 3g-wan6
192.168.4.0/24 br-lan