0
I have the following setup:
- One notebook with Debian Jessie with a static IP 192.168.1.2 for its Ethernet interface (set the connection profile through the GNOME network manager)
- One PC with Xubuntu 16.04 two network interfaces (set the connection profiles through the GNOME network manager):
- Static IP 192.168.1.4 - for connecting with my notebook OR the Raspberry Pi 2 (see next entry)
- Automatic (DHCP) - for connecting to the Internet through the bridge on the Raspberry Pi 3
Raspberry Pi 2 with the latest Rasbian and static IP 192.168.1.3
/etc/network/interfaces
allow-hotplug eth0 iface eth0 inet static address 192.168.1.3 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255
Raspberry Pi 3 the latest Rasbian and static IP address 192.168.1.2. There is a bridge between its WiFi interface and its Ethernet interface so that my PC can connect the Ethernet port (the interface of the PC is set to Automatic (DHCP)) and be able to access the Internet. I used this tutorial for the setup.
**/etc/wpa_supplicant/wpa_supplicant.conf*
network={ ... // SSID, encrypted password key etc. }
/etc/network/interfaces
allow-hotplug eth0 iface eth0 inet static address 192.168.1.2 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255
/etc/dnsmasq.conf
interface=eth0 listen-address=192.168.1.2 bind-interfaces server=8.8.8.8 domain-needed bogus-priv dhcp-range=192.168.1.100,192.168.1.254, 12h
/etc/sysctl.conf
Uncommented the line with
net.ipv4.ip_forward=1
Iptables configuration
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE iptables -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT
The problem I'm having is that I seem to be unable to use both the Pis connected to the PC even though they are attached to different network cards and their IP addresses are different but part of the same network. The automatic DCHP on the Pi 3 currently has given my PC (the interface it is connected to) the IP address 192.168.1.119.
I've noticed that whichever Pi I connect first to the PC works. The second connected doesn't (simple pinging provides me with the information). Next I have no problem connecting either of my Pi-s to my notebook - one provides me with Internet access (as expected; I turn off the WiFi adapter on the notebook for this) and the other with a "normal" Ethernet connection. I can also SSH from one machine to the other if connected (except for the case when the problem described above occurs).
I'm not that network savvy so some hints on what I'm doing wrong would be appreciated. If I can provide more information please do tell.