Useful Networking commands in Linux

To get a list/modify the network interfaces on the host run the command:

ip link

To see the IP addresses assigned to the interfaces:

ip addr

Set ip addresses on the interfaces, these will only be valid until the next restart.

ip addr add dev eth0

To persist the changes run set them in the /etc/network_interfaces file

Get the ip table route configuration:

ip route

Add to the ip table routing:

ip route add via

Check if IP forwarding is available on the host:

cat /proc/sys/net/ipv4/ip_forward