Networking basics Labs - switching and routing - Q9

Hello, I want to understand where the adrr 172.16.238.10 / 172.16.239.10 are coming from, how did we know this information? Why these addr act as gateways for jump host? I dont recall assigning these addr in previous questions :confused:

Thanks !

Let’s look at the IP addresses separately. 172.16.238.10 was assigned to eth0 on jump_host via the lab setup software; you didn’t set up, but it was set up from the start. From ip addr on jump_host:

11: eth0@if12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:ac:10:ee:0a brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 172.16.238.10/24 brd 172.16.238.255 scope global eth0
       valid_lft forever preferred_lft forever

This puts us on the same network as app01 and app02. But we need access to app03 and app04, which are on a separate network (172.16.239.0/24). So we create a new IP address on an interface that has access to that other network. It turns out that we can use eth0 for this, so we create the IP address using:

sudo ip addr add 172.16.239.10/24 dev eth0

Once we do that, we can route to all 4 appXX hosts:

hor@jump_host ~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         gateway         0.0.0.0         UG    0      0        0 eth0
172.16.238.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
172.16.239.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 eth1

1 Like

A diagram always helps. In this we can clearly see that jump_host has 2 interfaces, one connected to each network. Therefore to route from AppServer1 to Appserver 3 or 4, you must go via jump_host

1 Like

Got it, Thank you :+1: