- Take me to the Tutorial
-
Switching helps to connect the interface within same network.
-
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
-
Router helps to connect to two seprate networks together.
-
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.
- Lets get our hands on LABS