Skip to content

Instantly share code, notes, and snippets.

@rxw1
Last active March 17, 2019 03:21
Show Gist options
  • Save rxw1/06d0f31f115ebd015c05dcf372c1b248 to your computer and use it in GitHub Desktop.
Save rxw1/06d0f31f115ebd015c05dcf372c1b248 to your computer and use it in GitHub Desktop.
Linux Network Routing

Linux Network Routing

General

An introduction to Linux network routing (David Both)

/usr/bin/ip link set dev tun0 up mtu 1500

Enable and configure the TUN adapter at tun0.

/usr/bin/ip addr add dev tun0 192.121.66.237/26 broadcast 192.121.66.255

Add an address to tun0 and set its broadcast domain.

/usr/bin/ip route add 192.121.66.131/32 via 192.168.2.1

Add a route

/usr/bin/ip route add 0.0.0.0/1 via 192.121.66.193
/usr/bin/ip route add 128.0.0.0/1 via 192.121.66.193

0.0.0.0/1 128.0.0.0/1 192.121.66.255 192.121.66.237/26 192.121.66.131/32 192.121.66.193 192.168.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment