Linux-Basics-Complete-Course-With-Notes-Slides

Switching & Routing

#### Switching

  [~]$ ip link
  eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode
  DEFAULT group default qlen 1000
  [~]$ ip addr add 192.168.1.10/24 dev eth0

#### Routing

  [~]$ route
  Kernel IP routing table
  Destination Gateway Genmask Flags Metric Ref Use Iface
  [~]$ ip route add 192.168.2.0/24 via 192.168.1.1
  [~]$ route
  
  Kernel IP routing table
  Destination Gateway Genmask Flags Metric Ref Use Iface
  192.168.2.0 192.168.1.1 255.255.255.0 UG 0 0 0 eth0
  [~]$ ip addr
  [~]$ ip route