I have a raspberry Pi with three interfaces eth0 (Ethernet), wlan0 (WiFi), and wwan0 (via a GSM modem)
How can I test if an Internet connection is available via a certain interface? e.g. is my GSM(wwan0) modem connected to the Internet?
If I attempt to run ping www.google.com – How do I know what interface is being used?
How can I force connectivity via a certain interface if more than one exist?
Best Answer
How can I test if an Internet connection is available via a certain interface? e.g. is my GSM(wwan0) modem connected to the Internet? If I attempt to run ping www.google.com - How do I know what interface is being used?
You could specify the interface.
e.g:
Using a known IP address will eliminate any potential DNS issues while troubleshooting.
How can I force connectivity via a certain interface if more than one exist?
You can set the default route. Static addressing with Debian, right? Open
/etc/network/interfaces
with a text editor. Find the desired network interface and add the optiongateway x.x.x.x
, where x.x.x.x is the gateway. Save and restart networking:Otherwise, I believe one would need to use more advanced policy-based routing for this.