1

I have a Raspberry Pi (RPi) 3 running Raspbian 8 (Jessie) which is connected to my PC running Linux Mint via the Ethernet port. The RPi has the static eth0 address 192.168.2.213 and the PC has eth0 static address 192.168.2.100. Both devices identify the network broadcast as 192.168.2.255 and mask as 255.255.255.0. The PC's wlan0 adress is 192.168.1.153.

The problem is that I cannot share the Internet from PC wlan0 to RPi via the Ethernet. SSH works well, but my attempts to setup ip forwarding via iptables have failed. I have tried this and this but I have failed to setup network.

This is what I get when type "route" at RPi:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.1.100   0.0.0.0         UG    202    0        0 eth0
192.168.1.100   *               255.255.255.255 UH    202    0        0 eth0
192.168.2.0     *               255.255.255.0   U     202    0        0 eth0

migrated from askubuntu.com Nov 14 '16 at 16:47

This question came from our site for Ubuntu users and developers.

0

If your WLAN network is 192.168.1.0/24 and your wired network is 192.168.2.0/24, then on your RPI, having a 'default gateway' set to 192.168.1.100 is wrong. Its gateway should be an IP on its network.

Depending on how you defined this route (maybe /etc/network/interfaces?), you should start by replacing 192.168.1.100 references by 192.168.2.100.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy