Issue with RPI4 as wired router unable to connect to Internet

RPi4 connected to Port1 of TP-Link managed switch.

Switch is configured as: 802.1Q VLAN Enabled

VLAN1 Ports: 1-7; Tagged: 1; Untagged: 2-7;
VLAN2 Ports: 1,8; Tagged: 1; Untagged: 8; -> Port 8: PVID 2

root@OpenWrt:~# cat /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 'xxxx:xxxx:xxxx::/48'

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

config interface 'wan'
        option ifname 'eth1.2'
        option proto 'dhcp'
		option macaddr 'xx:xx:xx:xx:xx:xx'

After rebooting the modem (CM1000) I'm able to get DHCP working for short period of time
CM1000 ip addr: 192.168.100.1 and WAN: 192.168.100.10
I'm able to ping it but no internet connection and short after (maybe 5-10 sec) Network becomes unreachable

Here is part of the log:
Sat Jun 13 06:37:54 2020 kern.notice kernel: [  117.424952] r8152 2-1:1.0 eth1: Promiscuous mode enabled
Sat Jun 13 06:37:54 2020 kern.info kernel: [  117.432680] br-lan: port 1(eth1.1) entered blocking state
Sat Jun 13 06:37:54 2020 kern.info kernel: [  117.439645] br-lan: port 1(eth1.1) entered forwarding state
Sat Jun 13 06:37:54 2020 daemon.notice netifd: VLAN 'eth1.1' link is up
Sat Jun 13 06:37:54 2020 kern.info kernel: [  117.446847] IPv6: ADDRCONF(NETDEV_CHANGE): eth1.2: link becomes ready
Sat Jun 13 06:37:54 2020 daemon.notice netifd: VLAN 'eth1.2' link is up
Sat Jun 13 06:37:54 2020 daemon.notice netifd: Interface 'WAN' has link connectivity
Sat Jun 13 06:37:54 2020 daemon.notice netifd: Interface 'WAN' is setting up now
Sat Jun 13 06:37:54 2020 kern.info kernel: [  117.454941] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
Sat Jun 13 06:37:54 2020 daemon.notice netifd: bridge 'br-lan' link is up
Sat Jun 13 06:37:54 2020 daemon.notice netifd: Interface 'lan' has link connectivity
Sat Jun 13 06:37:54 2020 kern.notice kernel: [  117.463499] r8152 2-1:1.0 eth1: Promiscuous mode enabled
Sat Jun 13 06:37:54 2020 daemon.notice netifd: WAN (1068): udhcpc: started, v1.31.1
Sat Jun 13 06:37:54 2020 daemon.notice netifd: WAN (1068): udhcpc: sending discover
Sat Jun 13 06:37:55 2020 daemon.err odhcpd[613]: Failed to send to ff02::1%lan@br-lan (Address not available)
Sat Jun 13 06:37:56 2020 kern.notice kernel: [  118.814156] r8152 2-1:1.0 eth1: Promiscuous mode enabled
Sat Jun 13 06:37:56 2020 kern.notice kernel: [  119.133502] r8152 2-1:1.0 eth1: Promiscuous mode enabled
Sat Jun 13 06:37:57 2020 daemon.notice netifd: WAN (1068): udhcpc: sending discover
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[424]: exiting on receipt of SIGTERM
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: Connected to system UBus
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: started, version 2.81 cachesize 150
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: DNS service limited to local subnets
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: compile time options: IPv6 GNU-getopt no-DBus UBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-DNSSEC no-ID loop-detect inotify dumpfile
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: UBus support enabled: connected to system bus
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq-dhcp[1153]: DHCP, IP range 192.168.1.100 -- 192.168.1.249, lease time 12h
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: using only locally-known addresses for domain test
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: using only locally-known addresses for domain onion
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: using only locally-known addresses for domain localhost
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: using only locally-known addresses for domain local
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: using only locally-known addresses for domain invalid
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: using only locally-known addresses for domain bind
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: using only locally-known addresses for domain lan
Sat Jun 13 06:37:58 2020 daemon.warn dnsmasq[1153]: no servers found in /tmp/resolv.conf.d/resolv.conf.auto, will retry
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: read /etc/hosts - 4 addresses
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq[1153]: read /tmp/hosts/dhcp.cfg01411c - 2 addresses
Sat Jun 13 06:37:58 2020 daemon.info dnsmasq-dhcp[1153]: read /etc/ethers - 0 addresses
Sat Jun 13 06:38:00 2020 daemon.notice netifd: WAN (1068): udhcpc: sending discover
Sat Jun 13 06:38:12 2020 daemon.err uhttpd[683]: luci: accepted login on /admin/status/syslog for root from 192.168.1.103
Sat Jun 13 06:39:37 2020 daemon.notice netifd: WAN (1068): udhcpc: sending select for 192.168.100.10
Sat Jun 13 06:39:38 2020 daemon.notice netifd: WAN (1068): udhcpc: lease of 192.168.100.10 obtained, lease time 122
Sat Jun 13 06:39:38 2020 daemon.notice netifd: Interface 'WAN' is now up
Sat Jun 13 06:39:38 2020 user.notice firewall: Reloading firewall due to ifup of WAN (eth1.2)
Sat Jun 13 06:40:39 2020 daemon.notice netifd: WAN (1068): udhcpc: sending renew to 192.168.100.1
Sat Jun 13 06:41:10 2020 daemon.notice netifd: WAN (1068): udhcpc: sending renew to 0.0.0.0
Sat Jun 13 06:41:25 2020 daemon.notice netifd: WAN (1068): udhcpc: sending renew to 0.0.0.0
Sat Jun 13 06:41:32 2020 daemon.notice netifd: WAN (1068): udhcpc: sending renew to 0.0.0.0
Sat Jun 13 06:41:35 2020 daemon.notice netifd: WAN (1068): udhcpc: sending renew to 0.0.0.0
Sat Jun 13 06:41:36 2020 daemon.notice netifd: WAN (1068): udhcpc: sending renew to 0.0.0.0
Sat Jun 13 06:41:36 2020 daemon.notice netifd: WAN (1068): udhcpc: lease lost, entering init state
Sat Jun 13 06:41:36 2020 daemon.notice netifd: Interface 'WAN' has lost the connection

Your configuration looks correct. Are you using some USBtoEth adapter and there is eth1 instead of eth0?

Other than that the problem is that the dhcp lease is not renewed:

Sat Jun 13 06:41:36 2020 daemon.notice netifd: WAN (1068): udhcpc: sending renew to 0.0.0.0
Sat Jun 13 06:41:36 2020 daemon.notice netifd: WAN (1068): udhcpc: lease lost, entering init state

I suppose that since the wan interface comes up, it is working properly, but the dhcp server is not responding for some reason. Run a tcpdump to verify that:
tcpdump -i eth1.2 -evn udp port 67

Yes, I have USBtoEth adapter. But had the same result over Eth0
I will upload the result of the tcpdump later.
Meanwhile I was able to get internet connection to the WAN port after cloning the MAC address from my current router and just swapping the cables without restarting. But couldn't access the internet from the lan.
I'll run more tests later.

I noticed something strange while trying to figure this out

Sun Jun 14 00:52:40 2020 authpriv.info dropbear[8269]: Child connection from 187.111.221.177:55327
Sun Jun 14 00:52:42 2020 authpriv.warn dropbear[8269]: Bad password attempt for 'root' from 187.111.221.177:55327
Sun Jun 14 00:52:42 2020 authpriv.warn dropbear[8269]: Bad password attempt for 'root' from 187.111.221.177:55327
Sun Jun 14 00:52:43 2020 authpriv.warn dropbear[8269]: Bad password attempt for 'root' from 187.111.221.177:55327
Sun Jun 14 00:52:43 2020 authpriv.info dropbear[8269]: Exit before auth from <187.111.221.177:55327>: (user 'root', 3 fails): Max auth tries reached - user 'root'
Sun Jun 14 00:52:43 2020 authpriv.info dropbear[8270]: Child connection from 187.111.221.177:55333
Sun Jun 14 00:52:45 2020 authpriv.warn dropbear[8270]: Bad password attempt for 'root' from 187.111.221.177:55333
Sun Jun 14 00:52:45 2020 authpriv.warn dropbear[8270]: Bad password attempt for 'root' from 187.111.221.177:55333
Sun Jun 14 00:52:46 2020 authpriv.warn dropbear[8270]: Bad password attempt for 'root' from 187.111.221.177:55333
Sun Jun 14 00:52:46 2020 authpriv.info dropbear[8270]: Exit before auth from <187.111.221.177:55333>: (user 'root', 3 fails): Max auth tries reached - user 'root'
Sun Jun 14 00:52:46 2020 authpriv.info dropbear[8271]: Child connection from 187.111.221.177:55337
Sun Jun 14 00:52:49 2020 authpriv.warn dropbear[8271]: Bad password attempt for 'root' from 187.111.221.177:55337
Sun Jun 14 00:52:50 2020 authpriv.warn dropbear[8271]: Bad password attempt for 'root' from 187.111.221.177:55337
Sun Jun 14 00:52:50 2020 authpriv.warn dropbear[8271]: Bad password attempt for 'root' from 187.111.221.177:55337
Sun Jun 14 00:52:50 2020 authpriv.info dropbear[8271]: Exit before auth from <187.111.221.177:55337>: (user 'root', 3 fails): Max auth tries reached - user 'root'
Sun Jun 14 00:53:00 2020 authpriv.info dropbear[8272]: Child connection from 187.111.221.177:55347
Sun Jun 14 00:53:03 2020 authpriv.warn dropbear[8272]: Bad password attempt for 'root' from 187.111.221.177:55347
Sun Jun 14 00:53:03 2020 authpriv.warn dropbear[8272]: Bad password attempt for 'root' from 187.111.221.177:55347
Sun Jun 14 00:53:04 2020 authpriv.warn dropbear[8272]: Bad password attempt for 'root' from 187.111.221.177:55347
Sun Jun 14 00:53:04 2020 authpriv.info dropbear[8272]: Exit before auth from <187.111.221.177:55347>: (user 'root', 3 fails): Max auth tries reached - user 'root'
Sun Jun 14 00:53:05 2020 authpriv.info dropbear[8273]: Child connection from 187.111.221.177:55360
Sun Jun 14 00:53:07 2020 authpriv.warn dropbear[8273]: Bad password attempt for 'root' from 187.111.221.177:55360
Sun Jun 14 00:53:08 2020 authpriv.warn dropbear[8273]: Bad password attempt for 'root' from 187.111.221.177:55360
Sun Jun 14 00:53:08 2020 authpriv.warn dropbear[8273]: Bad password attempt for 'root' from 187.111.221.177:55360
Sun Jun 14 00:53:09 2020 authpriv.info dropbear[8273]: Exit before auth from <187.111.221.177:55360>: (user 'root', 3 fails): Max auth tries reached - user 'root'
Sun Jun 14 00:53:09 2020 authpriv.info dropbear[8275]: Child connection from 187.111.221.177:55368
Sun Jun 14 00:53:13 2020 authpriv.warn dropbear[8275]: Bad password attempt for 'root' from 187.111.221.177:55368
Sun Jun 14 00:53:13 2020 authpriv.warn dropbear[8275]: Bad password attempt for 'root' from 187.111.221.177:55368
Sun Jun 14 00:53:14 2020 authpriv.warn dropbear[8275]: Bad password attempt for 'root' from 187.111.221.177:55368
Sun Jun 14 00:53:14 2020 authpriv.info dropbear[8275]: Exit before auth from <187.111.221.177:55368>: (user 'root', 3 fails): Max auth tries reached - user 'root'
Sun Jun 14 00:53:17 2020 authpriv.info dropbear[8276]: Child connection from 187.111.221.177:55374
Sun Jun 14 00:53:19 2020 authpriv.warn dropbear[8276]: Bad password attempt for 'root' from 187.111.221.177:55374
Sun Jun 14 00:53:19 2020 authpriv.info dropbear[8276]: Exit before auth from <187.111.221.177:55374>: (user 'root', 1 fails): Disconnect received
Sun Jun 14 00:53:19 2020 authpriv.info dropbear[8277]: Child connection from 187.111.221.177:55383
Sun Jun 14 00:53:21 2020 authpriv.warn dropbear[8277]: Login attempt for nonexistent user
Sun Jun 14 00:53:22 2020 authpriv.info dropbear[8277]: Exit before auth from <187.111.221.177:55383>: Max auth tries reached - user 'is invalid'

Just someone trying to brute force in.

Most likely mac address binding from the provider side.

Post the firewall configuration too.

Following are some logs and configuration files:

cat /etc/config/firewall

config defaults
option syn_flood '1'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'

config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option network 'lan'

config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
option network 'wan6 WAN'

config forwarding
option src 'lan'
option dest 'wan'

config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'

config rule
option name 'Allow-Ping'
option src 'wan'
option proto 'icmp'
option icmp_type 'echo-request'
option family 'ipv4'
option target 'ACCEPT'

config rule
option name 'Allow-IGMP'
option src 'wan'
option proto 'igmp'
option family 'ipv4'
option target 'ACCEPT'

config rule
option name 'Allow-DHCPv6'
option src 'wan'
option proto 'udp'
option src_ip 'fc00::/6'
option dest_ip 'fc00::/6'
option dest_port '546'
option family 'ipv6'
option target 'ACCEPT'

config rule
option name 'Allow-MLD'
option src 'wan'
option proto 'icmp'
option src_ip 'fe80::/10'
list icmp_type '130/0'
list icmp_type '131/0'
list icmp_type '132/0'
list icmp_type '143/0'
option family 'ipv6'
option target 'ACCEPT'

config rule
option name 'Allow-ICMPv6-Input'
option src 'wan'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
list icmp_type 'router-solicitation'
list icmp_type 'neighbour-solicitation'
list icmp_type 'router-advertisement'
list icmp_type 'neighbour-advertisement'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'

config rule
option name 'Allow-ICMPv6-Forward'
option src 'wan'
option dest '*'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'

config rule
option name 'Allow-IPSec-ESP'
option src 'wan'
option dest 'lan'
option proto 'esp'
option target 'ACCEPT'

config rule
option name 'Allow-ISAKMP'
option src 'wan'
option dest 'lan'
option dest_port '500'
option proto 'udp'
option target 'ACCEPT'

config rule
option name 'Support-UDP-Traceroute'
option src 'wan'
option dest_port '33434:33689'
option proto 'udp'
option family 'ipv4'
option target 'REJECT'
option enabled 'false'

config include
option path '/etc/firewall.user'

cat /etc/config/dhcp

config dnsmasq
option domainneeded '1'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option localservice '1'

config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv6 'server'
option ra 'server'
option ra_slaac '1'
list ra_flags 'managed-config'
list ra_flags 'other-config'
option ra_management '1'

config dhcp 'wan'
option interface 'wan'
option ignore '1'

config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'

cat /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 'fdd6:5b5b:xxxx::/48'

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

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

logread | grep udhcpc

Sun Jun 14 01:00:48 2020 daemon.notice netifd: wan (1059): udhcpc: started, v1.31.1
Sun Jun 14 01:00:48 2020 daemon.notice netifd: wan (1059): udhcpc: sending discover
Sun Jun 14 01:00:52 2020 daemon.notice netifd: wan (1059): udhcpc: sending discover
Sun Jun 14 01:00:55 2020 daemon.notice netifd: wan (1059): udhcpc: sending discover
Sun Jun 14 01:06:53 2020 daemon.notice netifd: wan (1059): udhcpc: sending select for 192.168.100.10
Sun Jun 14 01:06:54 2020 daemon.notice netifd: wan (1059): udhcpc: lease of 192.168.100.10 obtained, lease time 122
Sun Jun 14 01:07:55 2020 daemon.notice netifd: wan (1059): udhcpc: sending renew to 192.168.100.1
Sun Jun 14 01:08:25 2020 daemon.notice netifd: wan (1059): udhcpc: sending renew to 0.0.0.0
Sun Jun 14 01:08:40 2020 daemon.notice netifd: wan (1059): udhcpc: sending renew to 0.0.0.0
Sun Jun 14 01:08:47 2020 daemon.notice netifd: wan (1059): udhcpc: sending renew to 0.0.0.0
Sun Jun 14 01:08:50 2020 daemon.notice netifd: wan (1059): udhcpc: sending renew to 0.0.0.0
Sun Jun 14 01:08:51 2020 daemon.notice netifd: wan (1059): udhcpc: sending renew to 0.0.0.0

tcpdump -i eth1.2 -evn udp port 67 (with cloned mac address from my current router)

01:10:16.544080 d8:eb:97:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from d8:eb:97:xx:xx:xx, length 300, xid 0x958cfc0e, secs 85, Flags [none]
Client-Ethernet-Address d8:eb:97:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
Requested-IP Option 50, length 4: 192.168.100.10
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.31.1"
Hostname Option 12, length 6: "GrrNet"
01:10:19.576083 d8:eb:97:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from d8:eb:97:xx:xx:xx, length 300, xid 0x958cfc0e, secs 88, Flags [none]
Client-Ethernet-Address d8:eb:97:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
Requested-IP Option 50, length 4: 192.168.100.10
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.31.1"
Hostname Option 12, length 6: "GrrNet"

tcpdump -i eth1.2 -evn udp port 67 (with the actual mac addr)

tcpdump: listening on eth1.2, link-type EN10MB (Ethernet), capture size 262144 bytes
01:14:50.748070 70:88:6b:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 70:88:6b:xx:xx:xx, length 300, xid 0x44a4ad60, secs 3, Flags [none]
Client-Ethernet-Address 70:88:6b:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.31.1"
Hostname Option 12, length 6: "GrrNet"
01:14:53.780082 70:88:6b:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 70:88:6b:xx:xx:xx, length 300, xid 0x44a4ad60, secs 6, Flags [none]
Client-Ethernet-Address 70:88:6b:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.31.1"
Hostname Option 12, length 6: "GrrNet"

Those messages from the tcpdump are repetitive without any changes if I leave it for few mins.

Switch:


Port 8 is PVID 2 the rest are 1

Let me know if I can provide more data. I have no clue what I'm missing. Sorry I'm new to OpenWRT.
Been lurking the forum for the past year and finally pulled the trigger to buy some equipment and give it a try. Wanted to go with r7800, but wasn't convinced with the price and the actual hardware.
Initially I wanted LibreCMC because I like the idea of blobless software.

Linux is case sensitive OS. Interface is with small letters in the network configuration.

1 Like

Do not run the DHCP client in the TP-Link switch. In a very bad design choice, the management system listens on all VLANs thus it can DHCP your public IP from the cable company. Set up the TP-Link with a static IP.

2 Likes

I believe I tried small letters and at some point I probably copy pasted something from somewhere with CAPs (maybe in LuCi). But good point I'll correct it.

I thought about disabling it but wasn't sure. Thank you for pointing that out.
I wasn't sure if TL-SG108PE is the best choice. I needed PoE for my AP. It was discounted when I got it.

Edit: So I fixed the capital letters and disabled the TP-Link DHCP function and did the dance with turning off everything and back on the switch first followed by the RPi4 and last Modem.

Same result

Sun Jun 14 04:27:45 2020 daemon.notice netifd: wan (1060): udhcpc: sending select for 192.168.100.10
Sun Jun 14 04:27:46 2020 daemon.notice netifd: wan (1060): udhcpc: lease of 192.168.100.10 obtained, lease time 122
Sun Jun 14 04:27:46 2020 daemon.notice netifd: Interface 'wan' is now up
Sun Jun 14 04:27:46 2020 user.notice firewall: Reloading firewall due to ifup of wan (eth1.2)

root@GrrNet:~# arp
IP address HW type Flags HW address Mask Device
192.168.100.1 0x1 0x2 00:xx:xx:xx:xx:xx * eth1.2
192.168.1.130 0x1 0x2 cc:xx:xx:xx:xx:xx * br-lan
192.168.1.103 0x1 0x2 1c:xx:xx:xx:xx:xx * br-lan

Sun Jun 14 04:28:47 2020 daemon.notice netifd: wan (1060): udhcpc: sending renew to 192.168.100.1
Sun Jun 14 04:28:57 2020 authpriv.info dropbear[1194]: Exit before auth from <192.168.1.103:8361>: Timeout before auth
Sun Jun 14 04:29:17 2020 daemon.notice netifd: wan (1060): udhcpc: sending renew to 0.0.0.0
Sun Jun 14 04:29:32 2020 daemon.notice netifd: wan (1060): udhcpc: sending renew to 0.0.0.0
Sun Jun 14 04:29:39 2020 daemon.notice netifd: wan (1060): udhcpc: sending renew to 0.0.0.0
Sun Jun 14 04:29:43 2020 daemon.notice netifd: wan (1060): udhcpc: sending renew to 0.0.0.0
Sun Jun 14 04:29:44 2020 daemon.notice netifd: wan (1060): udhcpc: sending renew to 0.0.0.0
Sun Jun 14 04:29:44 2020 daemon.notice netifd: wan (1060): udhcpc: lease lost, entering init state
Sun Jun 14 04:29:44 2020 daemon.notice netifd: Interface 'wan' has lost the connection
Sun Jun 14 04:30:51 2020 kern.info kernel: [ 432.133316] device eth1.2 entered promiscuous mode
Sun Jun 14 04:30:51 2020 kern.notice kernel: [ 432.141476] r8152 2-1:1.0 eth1: Promiscuous mode enabledtcpdump -i eth1.2 -evn udp port 67

04:42:18.412134 70:88:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 70:88:xx:xx:xx:xx, length 300, xid 0xd5e717b, secs 76, Flags [none]
Client-Ethernet-Address 70:88:xx:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.31.1"
Hostname Option 12, length 6: "GrrNet"

Not sure about this part:
70:88:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff,
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request
in particular ff.ff.ff.ff.ff and 0.0.0.0.68 does this look normal?

Also should I add option dns to the wan interface ?

Also is this patch https://github.com/openwrt/openwrt/pull/1017 introduced in the snapshot images for RPi4 ? Might be related with my issue?

This is normal.

Not necessarily. It should acquire it from dhcp.

Should be, they are from 2018.

Since you're doing everything with only one eth interface, why not just use the onboard one?

Also, which usb ethernet are you using?

I had the same result with the onboard one then I bought the USBtoEth to give it a try.
Got Cable Matters USB to Ethernet Adapter (USB 3.0 to Ethernet) from Amazon with kmod-usb-net-rtl8152

I didn't try to use one of it for wan and the other for lan at the same time yet.

It's trivial so give it a try to rule out the switch being misconfigured.

Switching to 2 ports configuration was able to access internet and got new real IP assigned. I also changed the netmask.

Those are the only changes I made:

root@#cat /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 'fdd6:5b5b:xxxx::/48'

config interface 'lan'
option type 'bridge'
option ifname 'eth0.1'
option proto 'static'
option ipaddr '10.10.1.1'
option netmask '255.0.0.0'
option ip6assign '64'

config interface 'wan'
option ifname 'eth1'
option proto 'dhcp'

I'm still wondering why cant make it work with only one Ethernet port.

Something wrong with the switch configuration most likely.

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

1 Like

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