I'm trying to build a multi-router setup in VirtualBox using FreeBSD machines as the routers. I have two VMs,
All of the remaining interfaces for both VM's are set up so I can SSH into the machines with host-only adapters. Each VM is configured to use a separate host-only interface.
I would like to avoid using DHCP. I know that might seem silly, but I'm using this as a learning exercise and want to do as much manually as possible, at least at first.
Here's the /etc/rc.conf for
And the /etc/resolv.conf for
And the
Here's the /etc/rc.conf for
And the /etc/resolv.conf for
And the
I'm sure that I'm missing something fundamental, but I'm not sure how to frame further inquiry intelligibly. Any advice is much appreciated.
router-1
and router-2
, which are on the same subnet and are able to ping one another.router-1
has a bridge interface with the host machine and is able to ping the wider internet. It gets it's IP dynamically from my home network's gateway.router-2
has a LAN interface configured to connect to router-1
.All of the remaining interfaces for both VM's are set up so I can SSH into the machines with host-only adapters. Each VM is configured to use a separate host-only interface.
I would like to avoid using DHCP. I know that might seem silly, but I'm using this as a learning exercise and want to do as much manually as possible, at least at first.
Here's the /etc/rc.conf for
router-1
:
Code:
hostname="router-1"
growfs_enable="YES"
# WAN --------- configuration for bridged adapter
ifconfig_em0="dhcp"
# SSH --------- configuration for host-only adapter in virtualbox (vboxnet0); needed for ssh
sshd_enable="YES"
ifconfig_em1="inet 192.168.99.1 netmask 255.255.255.0"
# LAN_0 ------- configuration for virtualbox internal network interface: routerNet1
ifconfig_em2="inet 10.0.0.1 netmask 255.255.255.0"
router-1
:
Code:
# Generated by resolvconf
search attlocal.net
nameserver 192.168.1.254
netstat -r
for router-1
:
Code:
Internet:
Destination Gateway Flags Netif Expire
10.0.0.0/24 link#3 U em2
router-1 link#3 UHS lo0
localhost link#4 UHS lo0
192.168.1.0/24 link#1 U em0
192.168.1.206 link#1 UHS lo0
192.168.99.0/24 link#2 U em1
192.168.99.1 link#2 UHS lo0
Here's the /etc/rc.conf for
router-2
:
Code:
hostname="router-2"
growfs_enable="YES"
# Gateway -------------- enable internetworking(?)
defaultrouter="10.0.0.1"
gateway_enable="YES"
# SSH ---------------- configuration of host-only adapter in vitualbox (vboxnet1); needed for ssh
sshd_enable="YES"
ifconfig_em0="inet 192.168.100.1 netmask 255.255.255.0"
# LAN_0 ------------- configuration for virtualbox internal network interface: routernet1
ifconfig_em1="inet 10.0.0.2 netmask 255.255.255.0"
router-2
:
Code:
nameserver 10.0.0.1
netstat -r
for router-2
:
Code:
Internet:
Destination Gateway Flags Netif Expire
default router-1.my.domain UGS em1
10.0.0.0/24 link#2 U em1
10.0.0.2 link#2 UHS lo0
localhost link#3 UHS lo0
192.168.100.0/24 link#1 U em0
192.168.100.1 link#1 UHS lo0
I'm sure that I'm missing something fundamental, but I'm not sure how to frame further inquiry intelligibly. Any advice is much appreciated.