Ping: bad address

I got a strange problem, updated openWrt from 21.02 to 22.03 on a x86 platform
now, openwrt cannot ping or opkg update.

# ping openwrt.org
ping: bad address 'openwrt.org'
# wget https://downloads.openwrt.org/releases/22.03.3/targets/ath79/generic/packages/Packages.gz
Resolving downloads.openwrt.org... failed: Try again.
wget: unable to resolve host address 'downloads.openwrt.org'

while, dnsmasq seems working fine

# nslookup openwrt.org
Server: 127.0.0.1
Address: 127.0.0.1:53
Non-authoritative answer:
Name: openwrt.org
Address: 139.59.209.225

Also, clients connected to LAN ports can access interenet too.

# cat /etc/config/network
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 ula_prefix 'fdef:c373:c9ef::/48'
	option packet_steering '1'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'

config interface 'wan'
	option device 'eth1'
	option proto 'dhcp'
	option ifname 'eth1'
	option peerdns '0'
	option dns '127.0.0.1'
	list dns '223.5.5.5'
	list dns '223.6.6.6'

config device
	option name 'eth2'
	option macaddr '64:3f:5f:a2:64:bb'

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option ifname 'eth0 eth2'
	option netmask '255.255.255.0'
	option ip6assign '64'
	option ip6hint '0'
	option ipaddr '192.168.99.1'
	option stp '1'
# cat /etc/config/dhcp
config dnsmasq
	option domainneeded '1'
	option localise_queries '1'
	option domain 'lan'
	option expandhosts '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option ednspacket_max '1232'
	option boguspriv '0'
	option nonwildcard '1'
	option authoritative '1'
	option dnssec '0'
	option dnsseccheckunsigned '0'
	option local '/lan/'
	option localservice '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	list server '127.0.0.1#5333'
	list server '223.5.5.5'
	list server '223.6.6.6'
	option noresolv '1'

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

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'
	option start '100'
	option limit '150'
	option leasetime '12h'
	list ra_flags 'none'

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

config dhcp 'WAN2'
	option interface 'WAN2'
	option ignore '1'

when using 21.02, it all works fine, but after updated, dns failds, i don't know why. can anyone please help?

are you sure the same port is still wan, as before the upgrade ?

Yes, I am quite sure

Remove the 127.0.0.1 dns. Try again.

1 Like

I tried, still don't work

Hi

out of curiosity ... could you try

root@dmz1:~# ping -4 openwrt.org
PING openwrt.org (139.59.209.225): 56 data bytes
64 bytes from 139.59.209.225: seq=0 ttl=55 time=19.811 ms
64 bytes from 139.59.209.225: seq=1 ttl=55 time=19.971 ms
^C

root@dmz1:~# ping -6 openwrt.org
PING openwrt.org (2a03:b0c0:3:d0::1af1:1): 56 data bytes
64 bytes from 2a03:b0c0:3:d0::1af1:1: seq=0 ttl=53 time=21.319 ms
64 bytes from 2a03:b0c0:3:d0::1af1:1: seq=1 ttl=53 time=20.075 ms
2 Likes

There are some odd things about your setup...

  • Did you keep settings from a previous version (or restore a backup from an older version)?

In the wan, you have device 'eth1' and ifname 'eth1' -- the ifname is old syntax and should be deleted

You have several invalid entries in the lan including bridge and ifname (with 2 entries). These won't work... so make it look like this:

config device 'br-lan'
	option type 'bridge'
	list ports 'eth0'
	list ports 'eth2'

config interface 'lan'
	option proto 'static'
	option device 'br-lan'
	option netmask '255.255.255.0'
	option ip6assign '64'
	option ip6hint '0'
	option ipaddr '192.168.99.1'

T

2 Likes

found that ping -4 works. ping -6 failed. so it is the ipv6 problem?

lets see output from

ip l
ip -6 a
ip -6 r

1 Like

thanks for helping, the follwing are the output

root@OpenWrt:~# ip -6 a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 240e:390:e6f:7920:1e1b:dff:fee9:eec3/64 scope global dynamic noprefixroute 
       valid_lft 597sec preferred_lft 597sec
    inet6 fe80::1e1b:dff:fee9:eec3/64 scope link 
       valid_lft forever preferred_lft forever
6: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fe80::2e0:4cff:fe68:16c/64 scope link 
       valid_lft forever preferred_lft forever
root@OpenWrt:~# ip -6 r
default from 240e:390:e6f:7920::/64 via fe80::d65d:64ff:fe33:7730 dev eth1 proto static metric 512 pref medium
240e:390:e6f:7920::/64 dev eth1 proto static metric 256 pref medium
unreachable 240e:390:e6f:7920::/64 dev lo proto static metric 2147483647 pref medium
unreachable fdef:c373:c9ef::/48 dev lo proto static metric 2147483647 pref medium
fe80::/64 dev eth3 proto kernel metric 256 pref medium
fe80::/64 dev eth1 proto kernel metric 256 pref medium

Ok

would you first make changes as @psherman suggested ?
to clean up /etc/config/network

config device 'br-lan'
	option type 'bridge'
	list ports 'eth0'
	list ports 'eth2'

config interface 'lan'
	option proto 'static'
	option device 'br-lan'
	option netmask '255.255.255.0'
	option ip6assign '64'
	option ip6hint '0'
	option ipaddr '192.168.99.1'

and

option ifname 'eth1'

and then please paste here again whole
/etc/config/network

looks like there IS ipv6 present on ETH1 but i don't known from where it is coming ? there is no wan6 interface

and these lines

unreachable 240e:390:e6f:7920::/64 dev lo proto static metric 2147483647 pref medium
unreachable fdef:c373:c9ef::/48 dev lo proto static metric 2147483647 pref medium

did you try to set some manual IPv6 somewhere ?

sorry for the late reply. I re-installed the openwrt, added a new 2.5G USB ethernet, but nothing changed.
here is the new /etc/config/network

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 ula_prefix 'fd83:dc44:9d68::/48'                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                
config device                                                                                                                                                                                                                                                                   
        option name 'br-lan'                                                                                                                                                                                                                                                    
        option type 'bridge'                                                                                                                                                                                                                                                    
        list ports 'eth0'                                                                                                                                                                                                                                                       
        list ports 'eth2'                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                
config interface 'lan'                                                                                                                                                                                                                                                          
        option device 'br-lan'                                                                                                                                                                                                                                                  
        option proto 'static'                                                                                                                                                                                                                                                   
        option ipaddr '192.168.99.1'                                                                                                                                                                                                                                            
        option netmask '255.255.255.0'                                                                                                                                                                                                                                          
        option ip6assign '60'                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                
config interface 'wan'                                                                                                                                                                                                                                                          
        option device 'eth1'                                                                                                                                                                                                                                                    
        option proto 'dhcp'                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                
config interface 'wan6'                                                                                                                                                                                                                                                         
        option device 'eth1'                                                                                                                                                                                                                                                    
        option proto 'dhcpv6'                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                
config interface 'docker'                                                                                                                                                                                                                                                       
        option device 'docker0'                                                                                                                                                                                                                                                 
        option proto 'none'                                                                                                                                                                                                                                                     
        option auto '0'                                                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                
config device                                                                                                                                                                                                                                                                   
        option type 'bridge'                                                                                                                                                                                                                                                    
        option name 'docker0'                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                
config interface 'wan2500'                                                                                                                                                                                                                                                      
        option proto 'dhcp'                                                                                                                                                                                                                                                     
        option device 'eth3'                                                                                                                                                                                                                                                    
        option hostname 'wrt2500'                                                                                                                                                                                                                                               
        option defaultroute '0'                                                                                                                                                                                                                                                 
        option macaddr '56:ce:b9:fd:72:9f'                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                
config interface 'wan2500v6'                                                                                                                                                                                                                                                    
        option proto 'dhcpv6'                                                                                                                                                                                                                                                   
        option device 'eth3'                                                                                                                                                                                                                                                    
        option reqaddress 'try'                                                                                                                                                                                                                                                 
        option reqprefix 'auto'                                                                                                                                                                                                                                                 
        option defaultroute '0' 

and the new /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        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'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'

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

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'

ping -4 works, but ping -6 still failed.

# ip l
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
2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 9a:b3:7b:7d:92:4a brd ff:ff:ff:ff:ff:ff
3: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel master br-lan state DOWN qlen 1000
    link/ether 1c:1b:0d:e9:ee:c1 brd ff:ff:ff:ff:ff:ff
4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    link/ether 1c:1b:0d:e9:ee:c3 brd ff:ff:ff:ff:ff:ff
5: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP qlen 1000
    link/ether 00:d0:4c:36:32:cc brd ff:ff:ff:ff:ff:ff
6: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    link/ether 56:ce:b9:fd:72:9f brd ff:ff:ff:ff:ff:ff
7: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 1c:1b:0d:e9:ee:c1 brd ff:ff:ff:ff:ff:ff
8: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN 
    link/ether 02:42:c0:86:c9:6e brd ff:ff:ff:ff:ff:ff
# ip -6 a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 240e:390:e6f:7920:1e1b:dff:fee9:eec3/64 scope global dynamic noprefixroute 
       valid_lft 599sec preferred_lft 599sec
    inet6 fe80::1e1b:dff:fee9:eec3/64 scope link 
       valid_lft forever preferred_lft forever
6: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 240e:390:e6f:7920:54ce:b9ff:fefd:729f/64 scope global dynamic noprefixroute 
       valid_lft 599sec preferred_lft 599sec
    inet6 fe80::54ce:b9ff:fefd:729f/64 scope link 
       valid_lft forever preferred_lft forever
7: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fd83:dc44:9d68::1/60 scope global noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fe80::1e1b:dff:fee9:eec1/64 scope link 
       valid_lft forever preferred_lft forever
# ip -6 r
fe80::/64 dev br-lan  metric 256 
fe80::/64 dev eth1  metric 256 
fe80::/64 dev eth3  metric 256 
anycast 240e:390:e6f:7920:: dev eth1  metric 0 
anycast 240e:390:e6f:7920:: dev eth3  metric 0 
anycast fd83:dc44:9d68:: dev br-lan  metric 0 
anycast fe80:: dev br-lan  metric 0 
anycast fe80:: dev eth1  metric 0 
anycast fe80:: dev eth3  metric 0 
multicast ff00::/8 dev br-lan  metric 256 
multicast ff00::/8 dev eth1  metric 256 
multicast ff00::/8 dev eth3  metric 256

did you try to set some manual IPv6 somewhere ?
No, I didn't

To solve the opkg update fails problem, I did the following things.

  1. rename /usr/bin/wget to /usr/bin/wget.bin
  2. add a new /usr/bin/wget script with the following contents
#!/bin/ash
/usr/bin/wget.bin -4 "$@"

now, the opkg update could work, but ping or other network programs still failds, like git

well, clearly, there IS ipv6 from somewhere
and this is not some private/ULA, it is valid public GUA

ok, as i see in your cfg, eth1 and eth3 are a two WAN interface
two WAN ?

but, biggest problem is that there is NO default ipv6 route

so, it is normal that ping -6 will fail
there is valid v6 address known for system, but there is no DEFAULT route

yes, now I have two WANs, a 1Gbps NIC for nomal remote access and a 2.5Gbps NIC for NAS access.

how can I add a DEFAULT ipv6 route?

wait
i could not understand that

what you try to achieve ?
normaly, there is one WAN port with
public v4 (and from there you make port forward, whatever to internal LAN servers)
public v6 with PD and this PD is distributed to LAN clients to everybody have own public IPv6 address

should you explain ?

and a 2.5Gbps NIC for NAS

what have this to do with WAN ?

I just want to use openwrt as a normal linux box, so I didn't connect devices to LAN.
the eth1(1Gbps) is used to remote control of the device
the eth3(2.5Gbps) is used to access NAS locally

eth3 is 2.5Gbps, use it as NAS port because it is faster.

ok, but then, please put ETH3 in LAN bridge, or make a separate bridge for this device
whatewer, this could NOT exist as WAN device

how can i add a default ipv6 route on eth1?
I never set ipv6 before, not familiar with ipv6

it seems there's something in the ipv6 route table

# route -A inet6
Kernel IPv6 routing table
Destination                                 Next Hop                                Flags Metric Ref    Use Iface
::/0                                        fe80::d65d:64ff:fe33:7730               UG    512    2        0 eth1    
240e:390:e6f:7920::/64                      ::                                      U     256    3        0 eth3    
240e:390:e6f:7920::/64                      ::                                      !n    2147483647 1        0 lo      
fd83:dc44:9d68::/64                         ::                                      U     1024   1        0 br-lan  
fd83:dc44:9d68::/48                         ::                                      !n    2147483647 2        0 lo      
fe80::/64                                   ::                                      U     256    2        0 br-lan  
fe80::/64                                   ::                                      U     256    1        0 eth1    
fe80::/64                                   ::                                      U     256    2        0 eth3    
::/0                                        ::                                      !n    -1     2        0 lo      
::1/128                                     ::                                      Un    0      5        0 lo      
240e:390:e6f:7920::/128                     ::                                      Un    0      3        0 eth1    
240e:390:e6f:7920::/128                     ::                                      Un    0      3        0 eth3    
240e:390:e6f:7920:1e1b:dff:fee9:eec3/128    ::                                      Un    0      5        0 eth1    
240e:390:e6f:7920:54ce:b9ff:fefd:729f/128   ::                                      Un    0      3        0 eth3    
fd83:dc44:9d68::/128                        ::                                      Un    0      3        0 br-lan  
fd83:dc44:9d68::1/128                       ::                                      Un    0      4        0 br-lan  
fe80::/128                                  ::                                      Un    0      3        0 br-lan  
fe80::/128                                  ::                                      Un    0      3        0 eth1    
fe80::/128                                  ::                                      Un    0      3        0 eth3    
fe80::1e1b:dff:fee9:eec1/128                ::                                      Un    0      5        0 br-lan  
fe80::1e1b:dff:fee9:eec3/128                ::                                      Un    0      3        0 eth1    
fe80::54ce:b9ff:fefd:729f/128               ::                                      Un    0      3        0 eth3    
ff00::/8                                    ::                                      U     256    5        0 br-lan  
ff00::/8                                    ::                                      U     256    3        0 eth1    
ff00::/8                                    ::                                      U     256    3        0 eth3    
::/0                                        ::                                      !n    -1     2        0 lo

look, default ipv6 route is obtained from upstream

so, only one WAN device facing your ISP
on this device (eth1) ISP will send you RA message, one /64 block and if you are lucky, one /58 PD

so you could not and should not set default ipv6 route by hand
unless your ISP told you so

in your setup, looks like eth1 and eth3 is somehow attached to same L2 layer facing ISP
so both interface get RA and /64 block

this is one reason why kernel could not decide where to send ipv6 packets

it is not normal to have two interfaces in same /64 block