Inspect tunnel config in /etc/network
In the previous steps, you used ip tunnel show
and ip link show
to see active tunnels and their corresponding interfaces. Now, let's look at where some network interface configurations are stored on a Debian-based system like Ubuntu: the /etc/network/interfaces
file.
This file is a common place to define network interfaces, including tunnels, that should be configured when the system starts.
You will use the cat
command to display the contents of this file. cat
is a simple command that reads files sequentially and prints them to the standard output.
Type the following command into your terminal and press Enter:
cat /etc/network/interfaces
You will see the content of the network interfaces configuration file. It might look something like this:
## interfaces(5) file used by ifup(8) and ifdown(8)
## Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
auto vti0
iface vti0 inet tunnel
mode ipip
address 192.168.1.1
netmask 255.255.255.0
local 10.0.0.1
remote 10.0.0.2
ttl 64
key 1234
This output shows how the vti0
tunnel interface is defined. You can see:
auto vti0
: This line indicates that the vti0
interface should be brought up automatically when the system starts.
iface vti0 inet tunnel
: Defines vti0
as a tunnel interface using the inet tunnel
family.
mode ipip
: Specifies the tunneling protocol (IP-in-IP).
address
, netmask
, local
, remote
: These lines define the IP addressing and endpoints for the tunnel.
ttl
: Sets the Time-to-Live for packets traversing the tunnel.
key
: Specifies a key used for the tunnel (if configured).
Note: The exact content of this file may vary depending on the system's configuration. However, the structure for defining interfaces, including tunnels, is generally similar.
Inspecting configuration files like /etc/network/interfaces
is crucial for understanding how your network interfaces, including tunnels, are set up persistently on the system.
You have now learned three different ways to examine network tunnels: listing them with ip tunnel show
, verifying their interfaces with ip link show
, and inspecting their configuration files.
Click Continue to complete this lab.