User Tools

Site Tools


documentation:examples:aggregating_multiple_isp_links_with_mlvpn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
documentation:examples:aggregating_multiple_isp_links_with_mlvpn [2020/02/21 21:29] – [Aggregated bandwidth] olivierdocumentation:examples:aggregating_multiple_isp_links_with_mlvpn [2020/02/21 21:40] – [Router 5 : MLVPN server] olivier
Line 13: Line 13:
 {{:documentation:examples:bsdrp-lab-mlvpn-details.png|}} {{:documentation:examples:bsdrp-lab-mlvpn-details.png|}}
  
-===== Virtual Lab setp =====+===== Virtual Lab setup =====
  
-This chapter will describe how to start each routers and configuring the centrals routers.+This chapter will describe how to start each routers and configuring the centrals routers.
  
 More information on these BSDRP lab scripts available on [[documentation:examples:How to build a BSDRP router lab]]. More information on these BSDRP lab scripts available on [[documentation:examples:How to build a BSDRP router lab]].
Line 22: Line 22:
  
 <code> <code>
-# ./tools/BSDRP-lab-bhyve.sh -n 5+# ./tools/BSDRP-lab-bhyve.sh -n 6
 BSD Router Project (http://bsdrp.net) - bhyve full-meshed lab script BSD Router Project (http://bsdrp.net) - bhyve full-meshed lab script
-Setting-up a virtual lab with VM(s): +Setting-up a virtual lab with VM(s): 
-- Working directory: /tmp/BSDRP +- Working directory: /root/BSDRP-VMs 
-- Each VM have core(s) and 256M RAM+- Each VM has a total of 1 (1 cores and 1 threads) and 512M RAM 
 +- Emulated NIC: virtio-net
 - Switch mode: bridge + tap - Switch mode: bridge + tap
 - 0 LAN(s) between all VM - 0 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 VM 5. +- vtnet3 connected to VM 5 
-VM 2 have the following NIC: +- vtnet4 connected to VM 6 
-- vtnet0 connected to VM 1. +VM 2 has the following NIC: 
-- vtnet1 connected to VM 3. +- vtnet0 connected to VM 1 
-- vtnet2 connected to VM 4. +- vtnet1 connected to VM 3 
-- vtnet3 connected to VM 5. +- vtnet2 connected to VM 4 
-VM 3 have the following NIC: +- vtnet3 connected to VM 5 
-- vtnet0 connected to VM 1. +- vtnet4 connected to VM 6 
-- vtnet1 connected to VM 2. +VM 3 has the following NIC: 
-- vtnet2 connected to VM 4. +- vtnet0 connected to VM 1 
-- vtnet3 connected to VM 5. +- vtnet1 connected to VM 2 
-VM 4 have the following NIC: +- vtnet2 connected to VM 4 
-- vtnet0 connected to VM 1. +- vtnet3 connected to VM 5 
-- vtnet1 connected to VM 2. +- vtnet4 connected to VM 6 
-- vtnet2 connected to VM 3. +VM 4 has the following NIC: 
-- vtnet3 connected to VM 5. +- vtnet0 connected to VM 1 
-VM 5 have the following NIC: +- vtnet1 connected to VM 2 
-- vtnet0 connected to VM 1. +- vtnet2 connected to VM 3 
-- vtnet1 connected to VM 2. +- vtnet3 connected to VM 5 
-- vtnet2 connected to VM 3. +- vtnet4 connected to VM 6 
-- vtnet3 connected to VM 4. +VM 5 has the following NIC: 
-For connecting to VM'serial console, you can use: +- vtnet0 connected to VM 1 
-- VM 1 : cu -l /dev/nmdm1B +- vtnet1 connected to VM 2 
-- VM 2 : cu -l /dev/nmdm2B +- vtnet2 connected to VM 3 
-- VM 3 : cu -l /dev/nmdm3B +- vtnet3 connected to VM 4 
-- VM 4 : cu -l /dev/nmdm4B +- vtnet4 connected to VM 6 
-- VM 5 : cu -l /dev/nmdm5B+VM 6 has the following NIC: 
 +- vtnet0 connected to VM 1 
 +- vtnet1 connected to VM 2 
 +- vtnet2 connected to VM 3 
 +- vtnet3 connected to VM 4 
 +To connect VM'serial console, you can use: 
 +- VM 1 : cu -l /dev/nmdm-BSDRP.1B 
 +- VM 2 : cu -l /dev/nmdm-BSDRP.2B 
 +- VM 3 : cu -l /dev/nmdm-BSDRP.3B 
 +- VM 4 : cu -l /dev/nmdm-BSDRP.4B 
 +- VM 5 : cu -l /dev/nmdm-BSDRP.5B 
 +- VM 6 : cu -l /dev/nmdm-BSDRP.6B
 </code> </code>
  
Line 67: Line 79:
 === Router 2 === === Router 2 ===
  
-Router 2 is configured for rate-limiting traffic at 10 Mb/s on interface to/from R1.+Router 2 is configured for rate-limiting traffic at 10 Mb/s on interface to/from VM1.
  
 <code> <code>
-sysrc hostname=R2 +sysrc hostname=VM2 \ 
-sysrc ifconfig_vtnet0="10.0.12.2/24" +        ifconfig_vtnet0="inet 10.0.12.2/24" \ 
-sysrc ifconfig_vtnet2="10.0.24.2/24" +        ifconfig_vtnet3="inet 10.0.25.2/24" \ 
-sysrc static_routes="R5" +        defaultrouter="10.0.25.5\ 
-sysrc route_R5="-net 10.0.45.0/24 10.0.24.4+        firewall_enable=YES \ 
-sysrc firewall_enable=YES +        firewall_script="/etc/ipfw.rules" 
-sysrc firewall_script="/etc/ipfw.rules" +cat > /etc/ipfw.rules <<EOF
- +
-cat > /etc/ipfw.rules <<'EOF'+
 #!/bin/sh #!/bin/sh
 fwcmd="/sbin/ipfw" fwcmd="/sbin/ipfw"
 kldstat -q -m dummynet || kldload dummynet kldstat -q -m dummynet || kldload dummynet
 # Flush out the list before we begin. # Flush out the list before we begin.
-${fwcmd} -f flush +\${fwcmd} -f flush 
-#Create pipes (one for each direction) +\${fwcmd} pipe 10 config bw 10Mbit/s 
-${fwcmd} pipe 10 config bw 10Mbit/s +\${fwcmd} pipe 20 config bw 10Mbit/s
-${fwcmd} pipe 20 config bw 10Mbit/s+
 #Traffic getting out vtnet0 is limited to 10Mbit/s #Traffic getting out vtnet0 is limited to 10Mbit/s
-${fwcmd} add 1000 pipe 10 all from any to any out via vtnet0+\${fwcmd} add 1000 pipe 10 all from any to any out via vtnet0
 #Traffic getting int vtnet0 is limited to 10Mbit/s #Traffic getting int vtnet0 is limited to 10Mbit/s
-${fwcmd} add 2000 pipe 20 all from any to any in via vtnet0+\${fwcmd} add 2000 pipe 20 all from any to any in via vtnet0
 #We don't want to block traffic, only shape some #We don't want to block traffic, only shape some
-${fwcmd} add 3000 allow ip from any to any +\${fwcmd} add 3000 allow ip from any to any 
-'EOF'+EOF
  
 service netif restart service netif restart
 service routing restart service routing restart
 service ipfw start service ipfw start
 +hostname VM2
 config save config save
 </code> </code>
Line 103: Line 113:
 === Router 3 === === Router 3 ===
  
-Router 3 is configured for rate-limiting traffic at 10 Mb/s on interface to/from R1.+Router 3 is configured for rate-limiting traffic at 10 Mb/s on interface to/from VM1.
  
 <code> <code>
-sysrc hostname=R3 +sysrc hostname=VM3 \ 
-sysrc ifconfig_vtnet0="10.0.13.3/24" +        ifconfig_vtnet0="inet 10.0.13.3/24" \ 
-sysrc ifconfig_vtnet2="10.0.34.3/24" +        ifconfig_vtnet3="inet 10.0.35.3/24" \ 
-sysrc static_routes="R5" +        defaultrouter="10.0.35.5\ 
-sysrc route_R5="-net 10.0.45.0/24 10.0.34.4+        firewall_enable=YES \ 
-sysrc firewall_enable=YES +        firewall_script="/etc/ipfw.rules"
-sysrc firewall_script="/etc/ipfw.rules"+
  
-cat > /etc/ipfw.rules <<'EOF'+cat > /etc/ipfw.rules <<EOF
 #!/bin/sh #!/bin/sh
 fwcmd="/sbin/ipfw" fwcmd="/sbin/ipfw"
 kldstat -q -m dummynet || kldload dummynet kldstat -q -m dummynet || kldload dummynet
 # Flush out the list before we begin. # Flush out the list before we begin.
-${fwcmd} -f flush +\${fwcmd} -f flush 
-#Create pipes (one for each direction) +\${fwcmd} pipe 10 config bw 10Mbit/s 
-${fwcmd} pipe 10 config bw 10Mbit/s +\${fwcmd} pipe 20 config bw 10Mbit/s
-${fwcmd} pipe 20 config bw 10Mbit/s+
 #Traffic getting out vtnet0 is limited to 10Mbit/s #Traffic getting out vtnet0 is limited to 10Mbit/s
-${fwcmd} add 1000 pipe 10 all from any to any out via vtnet0+\${fwcmd} add 1000 pipe 10 all from any to any out via vtnet0
 #Traffic getting int vtnet0 is limited to 10Mbit/s #Traffic getting int vtnet0 is limited to 10Mbit/s
-${fwcmd} add 2000 pipe 20 all from any to any in via vtnet0+\${fwcmd} add 2000 pipe 20 all from any to any in via vtnet0
 #We don't want to block traffic, only shape some #We don't want to block traffic, only shape some
-${fwcmd} add 3000 allow ip from any to any +\${fwcmd} add 3000 allow ip from any to any 
-'EOF'+EOF
  
 service netif restart service netif restart
 service routing restart service routing restart
 service ipfw start service ipfw start
 +hostname VM3
 config save config save
 </code> </code>
Line 139: Line 148:
 === Router 4 === === Router 4 ===
  
-Router 4 is the aggregating server'default gateway.+Router 4 is configured for rate-limiting traffic at 10 Mb/on interface to/from VM1.
  
 <code> <code>
-sysrc hostname=R4 +sysrc hostname=VM4 \ 
-sysrc ifconfig_vtnet1="10.0.24.4/24" +        ifconfig_vtnet0="inet 10.0.14.4/24" \ 
-sysrc ifconfig_vtnet2="10.0.34.4/24" +        ifconfig_vtnet3="inet 10.0.45.4/24" 
-sysrc ifconfig_vtnet3="10.0.45.4/24" +        defaultrouter="10.0.45.5"
-sysrc static_routes="R2 R3+        firewall_enable=YES \ 
-sysrc route_R2="-net 10.0.12.0/24 10.0.24.2" +        firewall_script="/etc/ipfw.rules" 
-sysrc route_R3="-net 10.0.13.0/24 10.0.34.3"+ 
 +cat > /etc/ipfw.rules <<EOF 
 +#!/bin/sh 
 +fwcmd="/sbin/ipfw" 
 +kldstat -q -m dummynet || kldload dummynet 
 +# Flush out the list before we begin. 
 +\${fwcmd} -f flush 
 +\${fwcmd} pipe 10 config bw 10Mbit/s 
 +\${fwcmd} pipe 20 config bw 10Mbit/s 
 +#Traffic getting out vtnet0 is limited to 10Mbit/s 
 +\${fwcmd} add 1000 pipe 10 all from any to any out via vtnet0 
 +#Traffic getting int vten0 is limited to 10Mbit/s 
 +\${fwcmd} add 2000 pipe 20 all from any to any in via vtnet0 
 +#We don't want to block traffic, only shape some 
 +\${fwcmd} add 3000 allow ip from any to any 
 +EOF 
 + 
 +service netif restart 
 +service routing restart 
 +service ipfw start 
 +hostname VM4 
 +config save 
 +</code> 
 + 
 +=== Router 5 === 
 + 
 +Router 5 is the aggregating server's default gateway. 
 + 
 +<code> 
 +sysrc hostname=R5 \ 
 +        ifconfig_vtnet1="inet 10.0.25.5/24"
 +        ifconfig_vtnet2="inet 10.0.35.5/24" \ 
 +        ifconfig_vtnet3="inet 10.0.45.5/24" \ 
 +        ifconfig_vtnet4="inet 10.0.56.5/24"
 +        static_routes="ISP1 ISP2 ISP3\ 
 +        route_ISP1="-host 10.0.12.10.0.25.2" \ 
 +        route_ISP2="-host 10.0.13.10.0.35.3" \ 
 +        route_ISP3="-host 10.0.14.1 10.0.45.4"
 service netif restart service netif restart
 service routing restart service routing restart
 +hostname VM5
 config save config save
 </code> </code>
Line 205: Line 252:
 </code> </code>
  
-==== Router : MLVPN server ====+==== Router : MLVPN server ====
  
-Router is configured as a aggregating server.+Router is configured as a aggregating server.
  
 <code> <code>
-sysrc hostname=R5 +sysrc hostname=VM6 \ 
-sysrc cloned_interfaces="lo1" +        cloned_interfaces="lo1" \ 
-sysrc ifconfig_lo1="inet 10.5.5.5/32" +        ifconfig_lo1="inet 10.6.6.6/32" \ 
-sysrc ifconfig_vtnet3="10.0.45.5/24" +        ifconfig_vtnet4="inet 10.0.56.6/24" \ 
-sysrc defaultrouter=10.0.45.+        defaultrouter="10.0.56.5" 
-sysrc mlvpn_enable=YES +cat > /usr/local/etc/mlvpn/mlvpn.conf <<EOF
- +
-cat <<'EOF' > /usr/local/etc/mlvpn/mlvpn.conf+
 [general] [general]
 statuscommand = "/usr/local/etc/mlvpn/mlvpn_updown.sh" statuscommand = "/usr/local/etc/mlvpn/mlvpn_updown.sh"
 tuntap = "tun" tuntap = "tun"
 mode = "server" mode = "server"
-ip4 = "10.0.15.5/30" +ip4 = "10.0.16.2/30" 
-ip4_gateway = "10.0.15.1"+ip4_gateway = "10.0.16.1"
 ip4_routes = "10.1.1.1/32" ip4_routes = "10.1.1.1/32"
 timeout = 30 timeout = 30
Line 231: Line 276:
  
 [adsl2] [adsl2]
-bindhost = "10.0.45.5"+bindhost = "10.0.56.6"
 bindport = 5082 bindport = 5082
  
 [adsl3] [adsl3]
-bindhost = "10.0.45.5"+bindhost = "10.0.56.6"
 bindport = 5083 bindport = 5083
-'EOF' 
  
 +[adsl4]
 +bindhost = "10.0.56.6"
 +bindport = 5084
 +
 +EOF
 +
 +service mlvpn enable
 service netif restart service netif restart
 service routing restart service routing restart
 service mlvpn start service mlvpn start
 +hostname VM6
 config save config save
 </code> </code>
documentation/examples/aggregating_multiple_isp_links_with_mlvpn.txt · Last modified: 2020/02/21 21:42 by olivier

Except where otherwise noted, content on this wiki is licensed under the following license: BSD 2-Clause
Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki