I'm struggling with my configuration of my Raspberry Pi. My Raspberry Pi 3 is connected to the Router via Wifi (wlan0). I created an access point with the Pi (wlan1) but I also want to be able to connect via ethernet (eth0) to the internet.
Everything just works fine, except if I want to use both at the same time. The moment I plug in the ethernet cable into a device, the devices connected to the access point have no internet anymore. Only the device connected over ethernet to the Pi has access to the internet. If e.g. my PC is connected via ethernet, then my phone can't access the internet (but it is connected to the access point and has an IP) until I unplug the PC from the Ethernet. It seems like the Ethernet gets prioritized over the access point and my Pi denies all data from the access point.
So basically i want to share the Internet (Wifi) of the router with my Raspberry Pi Access Point and my Raspberry Pi Ethernet.
Im running the latest Raspbian Stretch Desktop version. I don't have access to the router itself.
This is my setup:
interface=wlan1 driver=nl80211 hw_mode=g channel=11 ieee80211n=1 wmm_enabled=1 macaddr_acl=0 ignore_broadcast_ssid=0 auth_algs=1 wpa=2 wpa_key_mgmt=WPA-PSK rsn_pairwise=CCMP ssid=XXXX wpa_passphrase=XXXXXXXX
interface wlan1 static ip_address=192.168.220.1/24 interface eth0 static ip_address=192.168.220.2/24
interface=wlan1 listen-address=192.168.220.1 bind-dynamic server=22.214.171.124 domain-needed bogus-priv dhcp-range=192.168.220.50,192.168.220.150,12h
interface=eth0 listen-address=192.168.220.2 bind-dynamic server=126.96.36.199 domain-needed bogus-priv dhcp-range=192.168.220.50,192.168.220.150,12h
/etc/iptables.ipv4.nat (starting at boot)
*filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A FORWARD -i wlan0 -o wlan1 -m state --state RELATED,ESTABLISHED -j ACCEPT -A FORWARD -i wlan1 -o wlan0 -j ACCEPT COMMIT *nat :PREROUTING ACCEPT [0:0] :INPUT ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :POSTROUTING ACCEPT [0:0] -A POSTROUTING -o wlan0 -j MASQUERADE COMMIT
/etc/network/interfaces.d/interfaces-wlan0 (see comments)