Fri 14 Oct 2016 — Fri 19 Jan 2018

Networking on Linux

There is /etc/network/interfaces.

Network Manager

NetworkManager is a helpful thing from Gnome. When it's running, it controls the default route.

It comes with a thing called nm-applet which makes a little network status icon in your bar.

It overrides with /etc/network/interfaces, so you should comment out your devices (except for loopback) from there.

IfUpDown PLugin

There is an ifupdown plugin which lets Network Manager read from /etc/network/interfaces.

You can set managed=true inside /etc/NetworkManager/NetworkManager.conf

I didn't have much success with this.

Routes

When you connect to somewhere with VPN, you may need to set up some routes for the IP ranges on your network.

Connecting to the VPN will itself will add some extra routes:

default         *               0.0.0.0         U     1024   0        0 ppp0
10.0.0.255      *               255.255.255.255 UH    0      0        0 ppp0

In this example 10.0.0.255 is the network gateway that we've connected to. You'd see the same address in the ppp0 device if you ran ifconfig.

So this route is telling us that, to get to 10.0.0.255, we should go through the ppp0 interface.

However, we probably actually want that to happen for the whole 10.0.0.0-255 range.

route # list existing routes

## Get to the 10.0.0.0-255 range through the gateway 10.0.0.255 and using the ppp0 device.
sudo route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.0.0.255 dev ppp0

You can also configure these routes in the Network Manager Applet, under IPv4 settings.