Solved ping: UDP connect: No route to host

varda

Active Member

Reaction score: 25
Messages: 121

Hello Gentlemen.

New 13-STABLE setup:
Code:
# uname -a
FreeBSD server.localnetwork 13.0-STABLE FreeBSD 13.0-STABLE #0: Wed Jul  7 01:15:25 +05 2021     me@server.local/usr/obj/usr/src-13/amd64.amd64/sys/GENERIC  amd64
Dummy /etc/resolv.conf
Code:
nameserver 8.8.8.8
nameserver 8.8.4.4
Code:
# nslookup google.com
Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
Name:   google.com
Address: 142.251.1.101
Name:   google.com
Address: 142.251.1.113
Name:   google.com
Address: 142.251.1.100
Name:   google.com
Address: 142.251.1.138
Name:   google.com
Address: 142.251.1.139
Name:   google.com
Address: 142.251.1.102
Name:   google.com
Address: 2a00:1450:4010:c0b::66
Name:   google.com
Address: 2a00:1450:4010:c0b::8b
Name:   google.com
Address: 2a00:1450:4010:c0b::8a
Name:   google.com
Address: 2a00:1450:4010:c0b::71
Issue:
Code:
# ping google.com
ping: UDP connect: No route to host
But by IP is allright:
Code:
ping -c 3 142.251.1.101
PING 142.251.1.101 (142.251.1.101): 56 data bytes
64 bytes from 142.251.1.101: icmp_seq=0 ttl=105 time=165.703 ms
64 bytes from 142.251.1.101: icmp_seq=1 ttl=105 time=173.701 ms
64 bytes from 142.251.1.101: icmp_seq=2 ttl=105 time=165.114 ms

--- 142.251.1.101 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 165.114/168.173/173.701/3.917 ms

Any thought?
 
OP
V

varda

Active Member

Reaction score: 25
Messages: 121

Ok, replied to myself.

ping is now combined -4 and -6 IP versions. So it needs to supply corresponding switch to distinguish that in uncertain situations.
 

djuma

New Member


Messages: 1

I had the same problem. I discovered the default route was not set properly.
Execute netstat -nr command in your terminal to see whether the default route is Ok.
If not, set it by adding this configuration
Code:
defaultrouter="xx.xx.xx.xx"
to your /etc/rc.conf file. xx.xx.xx.xx is the router IP.
Then restart the network:
/etc/rc.d/netif restart && /etc/rc.d/routing restart.
 
Top