Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Feb 2023 12:37:31 +0200
From:      kodcode <kodcode@gmx.com>
To:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Default gateway not found at boot on RPI with WIFI
Message-ID:  <20230214123731.0519f9fc@inspiron>

next in thread | raw e-mail | index | archive | help
Hello.

I have a RaspberryPI 3B+ with an USB Network Adaptor that does not add
the default gateway at boot.
(Manually I can add it).
Maybe it's wortwhile mentioning that I have another machine on that
network (on Ethernet), its /etc/rc.conf I'll add at the end.

Here are some outputs:

1. Boot:
rtwn0 on uhub1
rtwn0: <802.11ac WLAN Adapter > on usbus1
rtwn0: MAC/BB RTL8821AU, RF 6052 1T1R
add host 127.0.0.1: gateway lo0 fib 0: route already in table
route: writing to routing socket: Network is unreachable
add net default: gateway 192.168.8.1 fib 0: Network is unreachable
ieee80211_load_module: load the wlan_amrr module by hand for now.
wlan0: Ethernet address: 98:48:27:c3:ed:93
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
--

2. /etc/rc.conf:
hostname="lemon"
sshd_enable="YES"
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
growfs_enable="YES"
#
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA inet 192.168.8.102 netmask 0xffffff00"
defaultrouter="192.168.8.1"
--

3. ifconfig:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ue0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80009<RXCSUM,VLAN_MTU,LINKSTATE>
        ether b8:27:eb:24:eb:a6
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu
1500 options=200001<RXCSUM,RXCSUM_IPV6>
        ether 98:48:27:c3:ed:93
        inet 192.168.8.102 netmask 0xffffff00 broadcast 192.168.8.255
        groups: wlan
        ssid NOS_Internet_7DF5 channel 5 (2432 MHz 11g ht/20) bssid
d0:65:ca:8c:7d:f5 regdomain FCC country US authmode WPA2/802.11i
privacy ON deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 7
scanvalid 60 protmode CTS ht20 ampdulimit 64k ampdudensity 4 shortgi
-stbc ldpctx -ldpcrx -uapsd wme roaming MANUAL
        parent interface: rtwn0
        media: IEEE 802.11 Wireless Ethernet DS/1Mbps mode 11ng
        status: associated
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
--

4. netstat -rn4:
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
127.0.0.1          link#1             UH          lo0
192.168.8.0/24     link#3             U         wlan0
192.168.8.102      link#3             UHS         lo0
--

5. Manual configuration:
root@lemon:~ # ping -c 3 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host
^C
--- 1.1.1.1 ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
root@lemon:~ # route add default 192.168.8.1
add net default: gateway 192.168.8.1
root@lemon:~ # netstat -rn4
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            192.168.8.1        UGS       wlan0
127.0.0.1          link#1             UH          lo0
192.168.8.0/24     link#3             U         wlan0
192.168.8.102      link#3             UHS         lo0
root@lemon:~ # ping -c 3 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: icmp_seq=0 ttl=48 time=104.063 ms
64 bytes from 1.1.1.1: icmp_seq=1 ttl=48 time=95.906 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=48 time=101.344 ms

--- 1.1.1.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 95.906/100.438/104.063/3.391 ms

6. Second machine on same network - I am connected via re0:
ifconfig_re0="inet 192.168.8.100 netmask 0xffffff00"
# WLAN Config
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA inet 192.168.8.101 netmask 0xffffff00"
defaultrouter="192.168.8.1"
--

Many thanks,
kodcode



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20230214123731.0519f9fc>