In this installment of our Home Lab series, we will be exploring the world of routing and how it can be used to connect multiple networks within a lab environment. We will be using vyOS-labrouter-01 as our router, and we will be adding a new system image to the router to enable routing capabilities.
To begin, let’s take a look at the current state of our lab network. Our lab network consists of two subnets: 10.0.1.0/24 and 192.168.5.0/24. The first subnet contains our main lab server, as well as a few client machines, while the second subnet contains a number of additional client machines.
Our goal is to connect these two subnets using routing, so that we can communicate between the machines on each subnet. To do this, we will need to add a new system image to our router, which will allow us to configure routing settings.
To add a new system image to our router, we will need to use the following command:
“`
sudo route -n add -net 10.0.1.0/24 192.168.5.99 add net 10.0.1.0: gateway 192.168.5.99
“`
This command will add a new routing rule to our router, which will allow us to route traffic from the 10.0.1.0/24 subnet to the 192.168.5.0/24 subnet. The `add net` command specifies the network that we want to route to, and the `gateway` option specifies the IP address of the router that we want to use as the gateway for this network.
Once we have added the new system image to our router, we can test our routing settings by pinging machines on both subnets. For example, we can ping the main lab server (10.0.1.10) from one of the client machines on the second subnet (192.168.5.10):
“`
$ ping 10.0.1.10
PING 10.0.1.10 (10.0.1.10) 56(84) bytes of data.
64 bytes from 10.0.1.10: icmp_seq=1 ttl=255 time=13.5 ms
64 bytes from 10.0.1.10: icmp_seq=2 ttl=255 time=13.5 ms
^C
“`
As we can see, the ping command is successful, and we are able to communicate between the two subnets. This demonstrates that our routing settings are working correctly, and that we are able to route traffic between the two subnets.
In conclusion, this blog post has demonstrated how to use routing to connect multiple networks within a home lab environment. We have added a new system image to our router, which has allowed us to configure routing settings and connect the two subnets. This has enabled us to communicate between the machines on each subnet, and has provided us with a more flexible and powerful lab network.