2

I've a Debian system without a UI, with a GPRS modem attached to it. Now, this system is connected with Ethernet through a standard cable.

I want to obtain a configuration that allows the computer to access the Internet via Ethernet if an Ethernet cable is connected, otherwise use the GPRS to do so. Practically speaking, I want the eth0 interface to be the preferable interface if it is on, and ppp (only) if the former isn't mounted.

How do I obtain an easy /etc/network/interfaces configuration to achieve this?

2 Answers 2

1

There are if-up.d and if-down.d directories in /etc/ppp/. You should put ifup and ifdown scripts there to configure your default gateway.

0

Assuming your Debian system has /sbin/ip help and /etc/iprout??/, iproute2 gives you the both a system-wide default gateway and a NIC/interface specific default gateway.

It is called source-based routing, as opposed to destination-based routing. The source in your case is the GPRS modem. See policyrouting.org or download Alexey Kuznetsov's IP command reference.

1
  • Can you add a primary reference to Alexey Kuznetsov's piece (1999?)? May 8, 2019 at 12:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .