Routed trough vyOS-labrouter-01
.
Diagram #
![Description](https://vninja.net/img/dvs01-isolated-network01.png)
DvSwitch01 Portgroups #
Portgroup | VLAN | IP Range |
---|---|---|
201-LAB201-10.0.1.0 | 201 | 10.0.1.0/24 |
202-LAB202-10.0.2.0 | 202 | 10.0.2.0/24 |
203-LAB203-10.0.3.0 | 203 | 10.0.3.0/24 |
204-LAB204-10.0.4.0 | 204 | 10.0.4.0/24 |
VyOs Router VM #
IPs #
Interface | VLAN | IP Assignment |
---|---|---|
eth0 | n/a | 192.168.5.99/24 |
eth1 | 201 | 10.0.1.1/24 |
eth2 | 202 | 10.0.2.1/24 |
eth3 | 203 | 10.0.3.1/24 |
eth4 | 204 | 10.0.4.1/24 |
VyOS Set interfaces #
set interfaces ethernet eth0 address 192.168.5.99/24
set interfaces ethernet eth1 address 10.0.1.1/24
set interfaces ethernet eth2 address 10.0.2.1/24
set interfaces ethernet eth3 address 10.0.3.1/24
set interfaces ethernet eth3 address 10.0.4.1/24
VyOS set NAT #
set nat source rule 10 outbound-interface eth0
set nat source rule 10 translation address masquerade
VyOS Static Routes #
set protocols static route 0.0.0.0/0 next-hop 192.168.5.2 (router)
VyOS Enable SSH #
VyOS DHCP Servers #
DHCP ETH1 #
set service dhcp-server shared-network-name DHCP_ETH1 subnet 10.0.1.0/24
set service dhcp-server shared-network-name DHCP_ETH1 authoritative
set service dhcp-server shared-network-name DHCP_ETH1 subnet 10.0.1.0/24 range 2 start 10.0.1.100
set service dhcp-server shared-network-name DHCP_ETH1 subnet 10.0.1.0/24 range 2 stop 10.0.1.200
set service dhcp-server shared-network-name DHCP_ETH1 subnet 10.0.1.0/24 default-router 10.0.2.1
DHCP ETH2 #
set service dhcp-server shared-network-name DHCP_ETH2 subnet 10.0.2.0/24
set service dhcp-server shared-network-name DHCP_ETH2 authoritative
set service dhcp-server shared-network-name DHCP_ETH2 subnet 10.0.2.0/24 range 2 start 10.0.2.100
set service dhcp-server shared-network-name DHCP_ETH2 subnet 10.0.2.0/24 range 2 stop 10.0.2.200
set service dhcp-server shared-network-name DHCP_ETH2 subnet 10.0.2.0/24 default-router 10.0.2.1
DHCP ETH3 #
set service dhcp-server shared-network-name DHCP_ETH3 subnet 10.0.3.0/24
set service dhcp-server shared-network-name DHCP_ETH3 authoritative
set service dhcp-server shared-network-name DHCP_ETH3 subnet 10.0.3.0/24 range 3 start 10.0.3.100
set service dhcp-server shared-network-name DHCP_ETH3 subnet 10.0.3.0/24 range 3 stop 10.0.3.200
set service dhcp-server shared-network-name DHCP_ETH3 subnet 10.0.3.0/24 default-router 10.0.3.1
DHCP ETH4 #
set service dhcp-server shared-network-name DHCP_ETH4 subnet 10.0.4.0/24
set service dhcp-server shared-network-name DHCP_ETH4 subnet 10.0.4.0/24 range 4 start 10.0.4.100
set service dhcp-server shared-network-name DHCP_ETH4 subnet 10.0.4.0/24 range 4 stop 10.0.4.200
set service dhcp-server shared-network-name DHCP_ETH4 subnet 10.0.4.0/24 default-router 10.0.4.1
Note: DNS is not set. #
VyOS configure DNS #
set system name-server <ip>
commit
save
Updating VyOS #
add system image {URL}
MacOS Static Route (non-persistent) #
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
sudo route -n add -net 10.0.1.0/24 192.168.5.99
sudo route -n add -net 10.0.2.0/24 192.168.5.99
sudo route -n add -net 10.0.3.0/24 192.168.5.99
sudo route -n add -net 10.0.4.0/24 192.168.5.99
This is a post in the Home Lab series. Posts in this series:
Post last updated on July 10, 2024: Update labnetwork.md