Menu
Coddy logo textTech

Two Networks

Lesson 14 of 35 in Coddy's LAN Labs course.

A router is a device with a foot in several networks: one interface per network, each with its own address inside that network. Traffic that must cross from one network to another goes through it.

Because a router has many interfaces, you name the one you are configuring: netlab ip ROUTER IFACE ADDR/PREFIX. netlab numbers router interfaces eth0, eth1, ... in the order they were cabled. By convention the router takes the first usable address of each network, the .1.

netlab show ip lists every interface in the lab, so it is the place to confirm a router really sits in both networks.

challenge icon

Challenge

Easy

Router r1 is cabled to switch sw1 (eth0, pc1's network 192.168.1.0/24) and directly to pc3 (eth1, network 10.0.0.0/24). Give r1 the .1 address in each network, then show the addressing view.

Expected output:

r1 eth0: 192.168.1.1/24 (mask 255.255.255.0, network 192.168.1.0/24)
r1 eth1: 10.0.0.1/24 (mask 255.255.255.0, network 10.0.0.0/24)
NODE  IFACE  ADDRESS          MASK           GATEWAY
pc1   eth0   192.168.1.10/24  255.255.255.0  -
pc3   eth0   10.0.0.20/24     255.255.255.0  -
r1    eth0   192.168.1.1/24   255.255.255.0  -
r1    eth1   10.0.0.1/24      255.255.255.0  -

Try it yourself

Terminal

All lessons in LAN Labs

Practice on your own: Terminal playground