1

I decided to use my Pi as a WiFi-AP, and followed the manual here: https://thepi.io/how-to-use-your-raspberry-pi-as-a-wireless-access-point/amp/

I did not setup a DHCP server though, because my router doesn't use DHCP.

The problem is when I create a bridge and specify it in the 'interfaces', the Pi loses network and internet connection and is also no longer available on both WiFi IP and Ethernet IP, though the AP works perfectly and the client can use both network and internet thru RPi WiFi. But I still need to maintain the network and internet connection on the Pi because I have an OVPN server there.

ifconfig

br0   Link encap:Ethernet  HWaddr b8:27:eb:ad:f6:53
      inet addr:169.254.178.44  Bcast:169.254.255.255  Mask:255.255.0.0
      inet6 addr: fe80::edde:9e5:199b:a4bb/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:1570 errors:0 dropped:0 overruns:0 frame:0
      TX packets:988 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:103082 (100.6 KiB)  TX bytes:369750 (361.0 KiB)

eth0  Link encap:Ethernet  HWaddr b8:27:eb:f8:a3:06
      inet addr:10.112.112.254  Bcast:10.112.112.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:19540336 errors:0 dropped:0 overruns:0 frame:0
      TX packets:19532722 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:3292605100 (3.0 GiB)  TX bytes:3195237339 (2.9 GiB)

lo        Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:154 errors:0 dropped:0 overruns:0 frame:0
      TX packets:154 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1
      RX bytes:60245 (58.8 KiB)  TX bytes:60245 (58.8 KiB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
      inet addr:10.8.0.1  P-t-P:10.8.0.1  Mask:255.255.255.0
      inet6 addr: fe80::f392:f90c:8b56:7fcf/64 Scope:Link
      UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
      RX packets:10409041 errors:0 dropped:0 overruns:0 frame:0
      TX packets:8785183 errors:0 dropped:123 overruns:0 carrier:0
      collisions:0 txqueuelen:100
      RX bytes:476065145 (454.0 MiB)  TX bytes:1736069459 (1.6 GiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:ad:f6:53
      inet addr:10.112.112.253  Bcast:10.112.112.255  Mask:255.255.255.0
      inet6 addr: fe80::2654:6e01:a51:7078/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:1570 errors:0 dropped:0 overruns:0 frame:0
      TX packets:1032 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:103082 (100.6 KiB)  TX bytes:400575 (391.1 KiB)

/etc/network/interfaces

source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

#auto br0
iface br0 inet static
bridge_ports eth0 wlan0
    address 10.112.112.252
    broadcast 10.112.112.255
    netmask 255.255.255.0
    gateway 10.112.112.1

/etc/dhcpcd.conf

hostname
clientid
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
require dhcp_server_identifier
nohook lookup-hostname
slaac private
interface eth0
    static ip_address=10.112.112.254/24
    static routers=10.112.112.1
    static domain_name_servers=1.1.1.1
interface wlan0
    static ip_address=10.112.112.253/24
denyinterfaces wlan0
denyinterfaces eth0

/etc/hostapd/hostapd.conf

interface=wlan0
bridge=br0
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
ssid=RPI3
wpa_passphrase=******

route

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.112.112.1    0.0.0.0         UG    202    0        0 eth0
10.8.0.0        *               255.255.255.0   U     0      0        0 tun0
10.112.112.0    *               255.255.255.0   U     202    0        0 eth0
10.112.112.0    *               255.255.255.0   U     303    0        0 wlan0
link-local      *               255.255.0.0     U     205    0        0 br0

I might have forgotten to include some data. If so, point it out, I'll include it ASAP. Thank you in advance.

  • Bridge has an IP, GW and netmask because someone told me that it should help. But it doesn't help. – Pavel Topouzidis Oct 18 '18 at 8:55
  • Is there any reason you DIDN'T actually follow the tutorial you linked? – Milliways Oct 18 '18 at 9:04
  • What do you mean? – Pavel Topouzidis Oct 18 '18 at 9:09
  • Yes, I thought about it right after hitting "post a question". The following is correct: "My router/network doesn't use DHCP and I don't need one, so I didn't install DHCP server on the Pi". – Pavel Topouzidis Oct 18 '18 at 9:26
0

As far as I understand the bridge works. Clients associated to the Access Point can connect to other clients no matter if they are on the AP or on wired ethernet. All clients can get into the internet. The only problem seems to be that the RasPi itself is not accessible. You write

...because my router doesn't use DHCP.

For what I understand this means the router does not has a DHCP server running and do not provide ip addresses to connected clients. So we have always to use static ip addresses.

Now coming to a bridge in general. It provides a common broadcast domain on different network segments, here the segments connected to eth0 and wlan0. These interfaces are slaves on the bridge. All clients connected to these interfaces have ip addresses from the same subnet, the subnet 10.112.112.0/24 the router uses on its wired port. This is also true for the RasPi itself as client (not as bridge). A bridge is working on OSI layer 2 and has nothing to do with ip addresses. It only uses mac addresses. So the first step should be to remove the ip addresses from eth0 and wlan0. They do not need that and only improves confusion.

Now we have to make the RasPi available on the (bridged) network as client by giving it a static ip address. But what interface should we use? We take the bridge interface br0 itself. It acts like a usual interface to the network. Give it a static ip address, maybe 10.112.112.252 and you should be able to address it like any other client on the network. Again, this ip address on br0 has nothing to do with the bridge itself. You have set an ip address to br0 as shown in /etc/network/interfaces but ifconfig does not reflect it. It shows an ip address 169.254.178.44, which is a self assigned ip address an interface gets without a DHCP server. Check why br0 does not accept the static ip address.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.