title: Routing from eth0 to eth1 on raspberry with Jessie Lite doesn't work
body: <p>I have a few Raspberry Pi2 loaded with Jessie lite on a network. I want them to share the internet connection of a 3G dongle, but I can't make it work.</p>
  
  <p>Here are some details:</p>
  
  <p>The RPi's are all on the same 10.0.0.x network, together with some other devices. I configured them (both RPi's and devices) with fixed IP address on the same subnet and that works fine, they can all talk each other.
  I need fixed IPs because I want to be able to NAT all devices and access them from the internet later.</p>
  
  <p>Only one RPi (eth0 address 10.0.0.10, let's call it RPi0) has an internet connection, which comes from a Huawei 3G dongle.
  The dongle creates an eth1 interface with an automatic address that seems to be always 192.168.8.100. If I try to force it to a manual IP, I can't access internet.</p>
  
  <p>Out of the box, when I plug the USB key, RPi0 can access to internet and resolve addresses.</p>
  
  <p>Now I'd like to let all the other devices on 10.0.0.x to access internet through the RPi that has the USB dongle. So I suppose 10.0.0.10 needs to work as a gateway and route the traffic through eth1. I have followed many tutorials up to know, but I must be missing something because I can't make it work.</p>
  
  <p>I have enabled NAT setting <code>net.ipv4.ip_forward=1 in /etc/sysctl.conf</code></p>
  
  <p>Then I try to specify a NAT rule for all the traffic that must go through eth1</p>
  
  <pre><code>sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
  </code></pre>
  
  <p>cannot ping anymore public IPs</p>
  
  <p>route looks like this:</p>
  
  <pre><code>Kernel IP routing table
  Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  default         hi.link         0.0.0.0         UG    247    0        0 eth1
  10.0.0.0        *               255.255.255.0   U     202    0        0 eth0
  192.168.8.0     *               255.255.255.0   U     247    0        0 eth1
  </code></pre>
  
  <p>what am I doing wrong?</p>
  
  <p>EDIT</p>
  
  <p>the dongle automatically creates an ethernet port with address 192.168.8.100, but the gateway address is 192.168.8.1 (which should be hi.link in the ip tables). 
  So I expect it working, the packets for the internet coming from other 10.0.0.x devices should be routed to the gateway. But they don't.</p>