1

As explained here, I built an Ethernet bridge using a Raspberry Pi 3b+.

As an extension, I am now trying to connect it to the internet via the WiFi interface.

For that I configured the wireless interface as shown here. Then I brought the wireless interface up using ifconfig wlan0 up. When I run ifconfig I can see the wlan0 interface in the list of interfaces (i.e. it's active). But it does not connect to a network.

I also noticed that when I make the changes provided in the first link, the complete networking capabilities (other than the bridge) of the RPi cease. (Although I am bridging only the two Ethernet interfaces)

Can someone please tell me what I am doing wrong?

mike65535
  • 141
  • 1
  • 1
  • 6
Nht_e0
  • 77
  • 1
  • 6

1 Answers1

2

I suppose you have completely setup and running Building a 'Packet squirrel" using Raspberry Pi you have linked in your question. It is using systemd-networkd. If you want to extend it with WiFi you also have to use systemd-networkd, in particular to use *.network configuration files. So try this and add setup wpa_supplicant in addition to the existing installation with your settings for country=, ssid= and psk= and enable it:

rpi ~# cat >/etc/wpa_supplicant/wpa_supplicant-wlan0.conf <<EOF
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="RPiNet"
    psk="verySecretMyPassword"
    key_mgmt=WPA-PSK
}
EOF

rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
rpi ~# systemctl disable wpa_supplicant.service
rpi ~# systemctl enable wpa_supplicant@wlan0.service

and then create this *.network file:

rpi ~# cat > /etc/systemd/network/08-wlan0.network <<EOF
[Match]
Name=wlan0
[Network]
# If you need a static ip address, then toggle commenting next four lines (example)
DHCP=yes
#Address=192.168.10.60/24
#Gateway=192.168.10.1
#DNS=84.200.69.80 1.1.1.1
EOF

Reboot
and it should do.

Ingo
  • 42,961
  • 20
  • 87
  • 207