kubernetes-training

Switching

Routing

Gateway

Linux host as a router

  1. Adding routing rule:
    • on A: ip route add 192.168.2.0/24 via 192.168.1.6
    • on C: p route add 192.168.1.0/24 via 192.168.2.6 -> After this step, A and C can ping, but there’s nothing show up.
    • Linux disable packets forwarding by default
  2. Enable packet fowarding
    • cat /proc/sys/net/ipv4/ip_forward : default is 0
    • set it to 1 -> enabled
    • the change isn’t persistent
    • to make it persistent: /etc/sysctl.conf