1

I'm trying to turn my Pi into a bridge using a wifi adapter and it's ethernet port plugged into the router through a couple floors worth of wires and switches. Doing so however removes me of the ability to ssh into it. I thought maybe it's because as the two interfaces are bridged, they lose their ip's and are controlled by br0, but sshd.conf has the default setup to listen on all ips (although on a different port than 22).

I am following the bridging section of this guide: https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md#internet-sharing

Through trial and error I discovered the problem occurs after editing /etc/network/interfaces. Here's my current file:

auto br0
iface br0 inet manual
bridge_ports eth0 wlan0
//
bridge_stp off
bridge_fd 0
bridge_maxwait 0
up /etc/init.d/ssh restart

The slashes are added here in to signify all lines under it are from another stack exchange question on the matter that suggested adding them, so I'm unsure what they do exactly, but adding them hasn't made a difference - ssh is unusable with just the first three, or all of them.

I am using a Pi-1.

muke
  • 167
  • 1
  • 1
  • 8
  • The options you have set to the bridge makes it complete transparent, means it is working like an old style network hub without switching. This is an workaround against limitation of the old linux bridge but no more needed with an up to date linux bridge. I don't use old style networking with /etc/networking/interfaces anymore. I could provide you a solution with systemd-networkd but I'm unsure if it works with the old RPi-1. May it be a possibility for you? – Ingo Sep 20 '18 at 13:29
  • +Ingo If you could point me in the direction of more up to date methods then yea that'd be great - I hear a lot about how the interfaces file is depreciated but I can't seem to find anywhere that offers alternatives to it! Also I'd imagine that your solution should work - it uses systemd and it's kernel is relatively up to date. – muke Sep 20 '18 at 16:36
  • I will give you an answer. – Ingo Sep 20 '18 at 21:40

1 Answers1

1

It's not explicit said that you want to make an access point but the official tutorial you have used is for that. Since version Jessie Raspbian comes with systemd which emulates all classic services for backward compatibility. The problem is that developing is going on and it is more and more difficult to emulate the old style services. At Compatibility with SysV you can see what effort was taken but follow the last sentence:

Note that there are some areas where systemd currently provides a certain amount of compatibility where we expect this compatibility to be removed eventually.

It could be one reason for your problems so I prefer to use systemd direct. With systemd-networkd it has all components included so you do not need to install and configure additional helper. I have taken that official tutorial as template that you also have used, but implemented it with systemd-networkd. You can find it at Setting up a Raspberry Pi as an access point - the easy way. Please have a look at the section Setting up an access point with a bridge.

Update
If you have setup the access point that way you will find it with a mobile phone. Showing the available networks, it is presented with name RPiNet and you can connect to it. On the RasPi you can also use the command (for example):

rpi ~$ sudo iw dev wlan0 info
phy#0
        Interface wlan0
                ifindex 3
                wdev 0x2
                addr b8:27:eb:06:e8:8b
                ssid RPiNet
                type AP
                channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz

As you can see it is type AP (access point) and it will also show you what channel it is using. A problem may be to translate a channel into frequency. The frequency must match a channel. You can look at List of WLAN channels. For example to use channel 36 on the 5.1 GHz band you have to set frequency=5180 in /etc/wpa_supplicant\wpa_supplicant.conf. But you must be sure that your wifi supports the 5.1 GHz band. You can check with sudo iw phy. This will give you a bunch of information. It must also contain supported frequencies above 5000 MHz. If you only see frequencies of 24xx MHz then of course you can only use this.

Ingo
  • 42,107
  • 20
  • 85
  • 197
  • Hey, thanks, I followed your guide and have no problems with ssh or anything else. Although I am wondering, and this may be stupid, how do I actually know the Pi is acting as an access point now? Is there any way to connect to it specifically over the router with something like my phone? I set the frequency to 5.8GHz on the Pi while the router's network is 2.4GHz, and it seems my phone is still using 2.4. – muke Sep 21 '18 at 00:34
  • @muke I have updated my answer. – Ingo Sep 21 '18 at 09:04