k8s.github.io

Pre-requisite Switching Routing Gateways

In this section, we will take a look at Switching, Routing and Gateways

Switching

$ ip link
$ ip addr

net-14

Routing

$ route
$ ip route show
or
$ ip route list
$ ip route add 192.168.1.0/24 via 192.168.2.1

net-15

Gateways

$ echo 1 > /proc/sys/net/ipv4/ip_forward


- Enable packet forwarding for IPv4.

$ cat /etc/sysctl.conf

Uncomment the line

net.ipv4.ip_forward=1


- To view the sysctl variables.

$ sysctl -a


- To reload the sysctl configuration.

$ sysctl –system ```