0

I have a Raspberry Pi that has two network interfaces. 1, eth0 which is the Pi's ethernet port connected to my LAN (gets internet via Comcast, I connect to the Pi via SSH on my MBP). 2, ppp0 which is a 4G USB dongle (connected to AT&T).

I would like to keep the ability to connect to my Pi via LAN but route requests to/from the internet via ppp0. This project is a Pi camera hooked up to gstreamer, I have it working on the local LAN now I want it to work via the IP address assigned to the 4G USB dongle.

How would I change my routing tables to "force a specific network".

Here are my interface configurations and routing table configurations.

eth0      Link encap:Ethernet  HWaddr b8:27:eb:bb:ef:7d  
      inet addr:192.168.1.185  Bcast:192.168.1.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:1556 errors:0 dropped:0 overruns:0 frame:0
      TX packets:926 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:110795 (108.1 KiB)  TX bytes:133594 (130.4 KiB)

ppp0      Link encap:Point-to-Point Protocol  
      inet addr:10.39.55.100  P-t-P:10.64.64.64  Mask:255.255.255.255
      UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
      RX packets:39 errors:0 dropped:0 overruns:0 frame:0
      TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:3 
      RX bytes:2526 (2.4 KiB)  TX bytes:2741 (2.6 KiB)


pi@rpi ~ $ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
2

You must change the default gateway.

To delete the old default gateway:

route del default

To add the new gateway:

route add default gw 10.64.64.64 dev ppp0

Your Answer

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

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