documentation:examples:simple_vrrp_lab
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| documentation:examples:simple_vrrp_lab [2026/02/27 09:20] – [Testing VRRP swap] olivier | documentation:examples:simple_vrrp_lab [2026/02/27 09:55] (current) – [Starting the lab] olivier | ||
|---|---|---|---|
| Line 13: | Line 13: | ||
| < | < | ||
| - | # ./ | + | # ./ |
| - | vmm module not loaded. Loading it... | + | |
| - | nmdm module not loaded. Loading it... | + | |
| - | if_tap module not loaded. Loading it... | + | |
| - | BSD Router Project (http:// | + | |
| Setting-up a virtual lab with 4 VM(s): | Setting-up a virtual lab with 4 VM(s): | ||
| - | - Working directory: /tmp/BSDRP | + | - Working directory: /home/ |
| - | - Each VM have 1 core(s) and 256M RAM | + | - Each VM has a total of 1 (1 cores and 1 threads) and 1G RAM |
| + | - Emulated NIC: virtio-net | ||
| + | - Boot mode: UEFI | ||
| - Switch mode: bridge + tap | - Switch mode: bridge + tap | ||
| - 2 LAN(s) between all VM | - 2 LAN(s) between all VM | ||
| - Full mesh Ethernet links between each VM | - Full mesh Ethernet links between each VM | ||
| - | VM 1 have the following NIC: | + | VM 1 has the following NIC: |
| - | - vtnet0 connected to VM 2. | + | - vtnet0 connected to VM 2 |
| - | - vtnet1 connected to VM 3. | + | - vtnet1 connected to VM 3 |
| - | - vtnet2 connected to VM 4. | + | - vtnet2 connected to VM 4 |
| - vtnet3 connected to LAN number 1 | - vtnet3 connected to LAN number 1 | ||
| - vtnet4 connected to LAN number 2 | - vtnet4 connected to LAN number 2 | ||
| - | VM 2 have the following NIC: | + | VM 2 has the following NIC: |
| - | - vtnet0 connected to VM 1. | + | - vtnet0 connected to VM 1 |
| - | - vtnet1 connected to VM 3. | + | - vtnet1 connected to VM 3 |
| - | - vtnet2 connected to VM 4. | + | - vtnet2 connected to VM 4 |
| - vtnet3 connected to LAN number 1 | - vtnet3 connected to LAN number 1 | ||
| - vtnet4 connected to LAN number 2 | - vtnet4 connected to LAN number 2 | ||
| - | VM 3 have the following NIC: | + | VM 3 has the following NIC: |
| - | - vtnet0 connected to VM 1. | + | - vtnet0 connected to VM 1 |
| - | - vtnet1 connected to VM 2. | + | - vtnet1 connected to VM 2 |
| - | - vtnet2 connected to VM 4. | + | - vtnet2 connected to VM 4 |
| - vtnet3 connected to LAN number 1 | - vtnet3 connected to LAN number 1 | ||
| - vtnet4 connected to LAN number 2 | - vtnet4 connected to LAN number 2 | ||
| - | VM 4 have the following NIC: | + | VM 4 has the following NIC: |
| - | - vtnet0 connected to VM 1. | + | - vtnet0 connected to VM 1 |
| - | - vtnet1 connected to VM 2. | + | - vtnet1 connected to VM 2 |
| - | - vtnet2 connected to VM 3. | + | - vtnet2 connected to VM 3 |
| - vtnet3 connected to LAN number 1 | - vtnet3 connected to LAN number 1 | ||
| - vtnet4 connected to LAN number 2 | - vtnet4 connected to LAN number 2 | ||
| - | For connecting to VM' | + | To connect |
| - | - VM 1 : cu -l /dev/nmdm1B | + | - VM 1 : sudo cu -l /dev/nmdm-BSDRP.1B |
| - | - VM 2 : cu -l /dev/nmdm2B | + | - VM 2 : sudo cu -l /dev/nmdm-BSDRP.2B |
| - | - VM 3 : cu -l /dev/nmdm3B | + | - VM 4 : sudo cu -l /dev/nmdm-BSDRP.4B |
| - | - VM 4 : cu -l /dev/nmdm4B | + | - VM 3 : sudo cu -l /dev/nmdm-BSDRP.3B |
| </ | </ | ||
| - | ===== Special notes for VLAN user ===== | ||
| - | Do not uses the default interface vlan name assignment (like " | ||
| ===== Configuring Routers ===== | ===== Configuring Routers ===== | ||
| Line 65: | Line 61: | ||
| < | < | ||
| sysrc hostname=R1 \ | sysrc hostname=R1 \ | ||
| + | kld_list+=" | ||
| ifconfig_vtnet3=" | ifconfig_vtnet3=" | ||
| ifconfig_vtnet4=" | ifconfig_vtnet4=" | ||
| - | | + | |
| - | cat <<EOF > / | + | |
| - | [VRID] | + | echo ' |
| - | serverid = 1 | + | kldload carp |
| - | interface = vtnet3 | + | service hostname restart |
| - | # This router is the master | + | |
| - | priority = 101 | + | |
| - | addr = 192.168.1.254/ | + | |
| - | # We want that this state is dependant with the state of vrid 2 | + | |
| - | vridsdep = 2 | + | |
| - | password = vrid1 | + | |
| - | + | ||
| - | [VRID] | + | |
| - | serverid = 2 | + | |
| - | interface = vtnet4 | + | |
| - | # This router is the master | + | |
| - | priority = 101 | + | |
| - | addr = 192.168.2.254/ | + | |
| - | password | + | |
| - | # We want that this state is dependant with the state of vrid 1 | + | |
| - | vridsdep = 1 | + | |
| - | EOF | + | |
| service netif restart | service netif restart | ||
| - | service freevrrpd start | + | sysctl net.inet.carp.preempt=1 |
| config save | config save | ||
| </ | </ | ||
| Line 98: | Line 78: | ||
| < | < | ||
| sysrc hostname=R2 \ | sysrc hostname=R2 \ | ||
| + | kld_list+=" | ||
| ifconfig_vtnet3=" | ifconfig_vtnet3=" | ||
| ifconfig_vtnet4=" | ifconfig_vtnet4=" | ||
| - | | + | |
| - | cat <<EOF > / | + | |
| - | [VRID] | + | echo ' |
| - | serverid = 1 | + | kldload carp |
| - | interface = vtnet3 | + | service hostname restart |
| - | # This router is the backup | + | |
| - | priority = 100 | + | |
| - | addr = 192.168.1.254/ | + | |
| - | # We want that this state is dependant with the state of vrid 2 | + | |
| - | vridsdep = 2 | + | |
| - | password = vrid1 | + | |
| - | + | ||
| - | [VRID] | + | |
| - | serverid = 2 | + | |
| - | interface = vtnet4 | + | |
| - | # This router is the backup | + | |
| - | priority = 100 | + | |
| - | addr = 192.168.2.254/ | + | |
| - | password | + | |
| - | # We want that this state is dependant with the state of vrid 1 | + | |
| - | vridsdep = 1 | + | |
| - | EOF | + | |
| service netif restart | service netif restart | ||
| - | service freevrrpd start | + | sysctl net.inet.carp.preempt=1 |
| config save | config save | ||
| </ | </ | ||
documentation/examples/simple_vrrp_lab.1772180450.txt.gz · Last modified: by olivier
