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
  • In the setup you have linked there is no WiFi involved. This would add an additional interface that may conflict with the bridge. So what exactly have done? – Ingo Aug 11 '19 at 16:50
  • After building the bridge, I configured the wireless interface as given here. Then I brought the interface up using
    ifconfig wlan0 up.
    When I type ifconfig I can see the wlan0 interface active, but it doesn't connect to the network
    – Nht_e0 Aug 12 '19 at 14:45
  • Please add this information to your question. You can edit it. Then I will make an answer. – Ingo Aug 13 '19 at 07:08
  • @Ingo I edited the question – Nht_e0 Aug 13 '19 at 14:01

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,107
  • 20
  • 85
  • 197
  • After completing this step, the internet connectivity of the network where the bridge is connected (i.e., the network provided by the AP in the first question) is lost. Any idea why? – Nht_e0 Aug 14 '19 at 15:32
  • @Nht_e0 No, but I will test it. Just a moment please. What first question do you mean? – Ingo Aug 14 '19 at 16:57
  • @Please take your time :). The question I have linked to this one – Nht_e0 Aug 14 '19 at 16:58
  • 1
    @Nht_e0 I have just setup my RPi 4B as described at Building a 'Packet squirrel" using Raspberry Pi and with the extension from this answer. Everything works fine as expected. What is the different to your setup? Where does your setup does not match exactly my installation? To what destination do you connect with WiFi and wired? Is it the same router? – Ingo Aug 14 '19 at 19:23
  • I did play around with the network settings sometime ago after setting up the bridge. Let me check this on a fresh install. As for the setup, I'm trying this on a RPi 3B+ (which I don't think is an issue). I tried to connect to connect to the same router – Nht_e0 Aug 14 '19 at 20:53
  • @Nht_e0 Using RPi 3B+ should also do. Connecting to the same router, onetime wired (the sniffed line), onetime by WiFi, is no problem as long as you don't give the bridge an ip address. But I don't understand your effort. Just giving the bridge an ip address as described in the setup has the same effect. You don't need WiFi. It only makes sense if you want to connect to another device than the router to manage the RasPi. – Ingo Aug 15 '19 at 07:54
  • it worked after I tried it on a fresh install of Raspbian. As for the reason, I'm just playing around with this :) However, if you do give the bridge an IP address, doesn't it loose the capability to listen? – Nht_e0 Aug 15 '19 at 17:11