WAN port problem

Hi,

I have flashed my router using:
https://downloads.openwrt.org/snapshots/targets/ramips/mt76x8/openwrt-ramips-mt76x8-unielec_u7628-01-16m-squashfs-sysupgrade.bin

the WAN port is not Working,

The modem has 2 Ports, LAN and WAN, here is my /etc/config/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 'fddd:9b63:ad93::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0.1'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option macaddr 'f8:62:xx:xx:xx:xx'
		
config interface 'wan'
	option ifname 'eth0.2'
	option proto 'dhcp'

config device 'wan_eth0_2_dev'
	option name 'eth0.2'
	option macaddr 'f8:62:xx:xx:xx:xx'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto 'dhcpv6'

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'

ifconfig output:

root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr F8:62:xx:xx:xx:xx
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd38:eaf:d309::1/60 Scope:Global
          inet6 addr: fe80::fa62:aaff:fe20:78/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:194 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:16523 (16.1 KiB)  TX bytes:10014 (9.7 KiB)

eth0      Link encap:Ethernet  HWaddr F8:62:xx:xx:xx:xx
          inet6 addr: fe80::fa62:aaff:fe20:78/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:339 errors:0 dropped:5 overruns:0 frame:0
          TX packets:110 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:32639 (31.8 KiB)  TX bytes:19512 (19.0 KiB)
          Interrupt:5

eth0.1    Link encap:Ethernet  HWaddr F8:62:xx:xx:xx:xx
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:196 errors:0 dropped:2 overruns:0 frame:0
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:16615 (16.2 KiB)  TX bytes:10014 (9.7 KiB)

eth0.2    Link encap:Ethernet  HWaddr F8:62:xx:xx:xx:xx
          inet6 addr: fe80::fa62:aaff:fe20:79/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:5166 (5.0 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:88 errors:0 dropped:0 overruns:0 frame:0
          TX packets:88 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6864 (6.7 KiB)  TX bytes:6864 (6.7 KiB)

but WAN port can not get DHCP and works as a bridge,

I think there is something wrong with VLAN tagging, but I can not figure it,
PS: my openwrt does not have LUCI so I have to go from CLI

please guide me

Check the other ports, sometimes the config in the image is wrong, and a different port
than WAN gets assigned as WAN.

2 Likes

Identify which switchport is the wan port.
Run swconfig dev eth0 show and monitor which ports show as UP. Plug/unplug a few cables to pinpoint the wan port.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.