The wan interface cannot obtain a dhcp address, but pc can

network config:


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

config globals 'globals'
        option preferred_time '43200'
        option valid_time '43200'
        option disabled '0'
        option ula_prefix 'fdfe:7ca8:9deb::/48'
        option mode 'router'

config device 'veth1'
        option name 'veth1'
        option macaddr '00:0C:E7:00:00:01'
        option defaddr '00:0C:E7:00:00:01'

config device 'veth2'
        option name 'veth2'
        option macaddr '00:0C:E7:00:00:02'
        option defaddr '00:0C:E7:00:00:02'

config device 'veth3'
        option name 'veth3'
        option macaddr '00:0C:E7:00:00:03'
        option defaddr '00:0C:E7:00:00:03'

config device 'veth4'
        option name 'veth4'
        option macaddr '00:0C:E7:00:00:04'
        option defaddr '00:0C:E7:00:00:04'

config device 'veth5'
        option name 'veth5'
        option macaddr '00:0C:E7:00:00:05'
        option defaddr '00:0C:E7:00:00:05'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.0.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option ifname 'veth1'
        option device 'veth1'
        option proto 'dhcp'
        option peerdns '1'
        option disabled '0'
        option macaddr '00:0C:E8:00:00:01'
        option hostname 'LINK-000CE8000001'

config interface 'wan6'
        option proto 'dhcpv6'
        option device '@wan'

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

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

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '4 5'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'veth2'
        list ports 'veth3'
        list ports 'veth4'
        list ports 'veth5'
        option macaddr '00:0C:E8:00:00:02'

dhcp config:

config dnsmasq
        option domainneeded     1
        option boguspriv        1
        option filterwin2k      0  # enable for dial on demand
        option localise_queries 1
        option rebind_protection 0  # disable if upstream must serve RFC1918 addresses
        option rebind_localhost 1  # enable for RBL checking and similar services
        #list rebind_domain example.lan  # whitelist RFC1918 responses for domains
        option local    '/lan/'
        option domain   'lan'
        option expandhosts      1
        option nonegcache       0
        option authoritative    1
        option readethers       1
        option leasefile        '/tmp/dhcp.leases'
        option resolvfile       '/tmp/resolv.conf.d/resolv.conf.auto'
        #list server            '/mycompany.local/1.2.3.4'
        option nonwildcard      1 # bind to & keep track of interfaces
        #list interface         br-lan
        #list notinterface      lo
        #list bogusnxdomain     '64.94.110.11'
        option localservice     1  # disable to allow DNS requests from non-local subnets
        option ednspacket_max   1232

config dhcp lan
        option interface        lan
        option start    100
        option limit    150
        option leasetime        43200s
        option dhcpv6 'disabled'
        option ra 'disabled'
        option ra_default '1'
        option ra_lifetime '1800'

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'

What is the output of:

ubus call system board
root@OpenWrt:/# ubus call system board
{
        "kernel": "5.4.194",
        "hostname": "OpenWrt",
        "system": "ARMv8 Processor rev 4",
        "model": "MediaTek MT7981 RFB",
        "board_name": "mediatek,mt7981-spim-snand-rfb",
        "release": {
                "distribution": "OpenWrt",
                "version": "21.02-SNAPSHOT",
                "revision": "r0-e64f106f1",
                "target": "mediatek/mt7981",
                "description": "OpenWrt 21.02-SNAPSHOT r0-e64f106f1"
        }
}

This firmware is not from the official OpenWrt project.

Please reach out to the vendor/maintainer who provided the firmware you are running. Alternatively, you can install official OpenWrt as your device is supported. If you do install official OpenWrt, do not keep settings upon upgrade as they will not be compatible.

2 Likes

@caixukunbest this isn't your 1st rodeo, didn't you learn anything last time ?

1 Like

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