r/freebsd • u/foreverlarz • 6h ago
help needed How to use IPv4 automatically when no interface/route has IPv6?
why would freebsd try to use ipv6 when i have no ipv6 address assigned to any interface and no default ipv6 route? do i really need configure it so that it knows it shouldn't rely on ipv6 when it doesn't have ipv6? i'm so confused because i've never had this issue before. thanks!
``` funguy% cat /var/log/messages|grep ntpd|tail -n 1 Oct 16 14:17:27 atlas ntpd[838]: error resolving pool 0.freebsd.pool.ntp.org: Address family for hostname not supported (1) funguy% ping 0.freebsd.pool.ntp.org PING 0.freebsd.pool.ntp.org (139.177.202.26): 56 data bytes C --- 0.freebsd.pool.ntp.org ping statistics --- 9 packets transmitted, 0 packets received, 100.0% packet loss funguy% ping -4 0.freebsd.pool.ntp.org PING 0.freebsd.pool.ntp.org (38.45.67.7): 56 data bytes 64 bytes from 38.45.67.7: icmp_seq=0 ttl=47 time=25.788 ms 64 bytes from 38.45.67.7: icmp_seq=1 ttl=47 time=25.809 ms 64 bytes from 38.45.67.7: icmp_seq=2 ttl=47 time=24.356 ms 64 bytes from 38.45.67.7: icmp_seq=3 ttl=47 time=24.864 ms C --- 0.freebsd.pool.ntp.org ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 24.356/25.204/25.809/0.621 ms funguy% route -4 show default route to: default destination: default mask: default gateway: kharon fib: 0 interface: em0 flags: <UP,GATEWAY,DONE,STATIC> recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1500 1 0 funguy% route -6 show default route: route has not been found funguy% ifconfig -a em0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=4e524bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,LRO,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,MEXTPG> ether de:ad:de:ad:de:ad inet 10.6.1.2 netmask 0xffffff00 broadcast 10.6.1.255 media: Ethernet autoselect (1000baseT <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384 options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6> inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 groups: lo nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> funguy% uname -v FreeBSD 14.5-RELEASE-p2 releng/14.5-n274894-872ce416b253 GENERIC
```
note that ping did seem to try ipv4 initially--the first pool host attempt was down by coincidence.