Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 1.46 KB

03-Networking-Basics.md

File metadata and controls

69 lines (45 loc) · 1.46 KB

Switching & Routing

Switching

  • Switching helps to connect the interface within same network.

    switch

  • To see the interfaces on the hosts use ip link command

[~]$ ip link
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode
DEFAULT group default qlen 1000
  • To connect to the switch we use ip addr add command
[~]$ ip addr add 192.168.1.10/24 dev eth0

Routing

  • Router helps to connect to two seprate networks together.

    route

  • To see the existing routing table configuration run the route command.

[~]$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
  • To configure a gateway on system B to reach the system on other network run
[~]$ 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
  • To see the ip addresses assign to interfaces use
[~]$ ip addr
[~]$ ip route
  • To make this changes permanent you must set them in /etc/network/interfaces file.

HANDS-ON LAB

  • Lets get our hands on LABS