documentation:examples:aggregating_multiple_isp_links_with_mlvpn
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| documentation:examples:aggregating_multiple_isp_links_with_mlvpn [2020/02/21 21:24] – [Links bandwidth] olivier | documentation:examples:aggregating_multiple_isp_links_with_mlvpn [2020/02/21 21:42] (current) – [Aggregated bandwidth] olivier | ||
|---|---|---|---|
| Line 13: | Line 13: | ||
| {{: | {{: | ||
| - | ===== Virtual Lab setp ===== | + | ===== Virtual Lab setup ===== |
| - | This chapter will describe how to start each routers and configuring the 3 centrals routers. | + | This chapter will describe how to start each routers and configuring the 4 centrals routers. |
| More information on these BSDRP lab scripts available on [[documentation: | More information on these BSDRP lab scripts available on [[documentation: | ||
| Line 22: | Line 22: | ||
| < | < | ||
| - | # ./ | + | # ./ |
| BSD Router Project (http:// | BSD Router Project (http:// | ||
| - | Setting-up a virtual lab with 5 VM(s): | + | Setting-up a virtual lab with 6 VM(s): |
| - | - Working directory: /tmp/BSDRP | + | - Working directory: /root/BSDRP-VMs |
| - | - Each VM have 1 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 | + | - 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 |
| - | - 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 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 / | ||
| </ | </ | ||
| Line 67: | Line 79: | ||
| === Router 2 === | === Router 2 === | ||
| - | Router 2 is configured for rate-limiting traffic at 10 Mb/s on interface to/ | + | Router 2 is configured for rate-limiting traffic at 10 Mb/s on interface to/ |
| < | < | ||
| - | sysrc hostname=R2 | + | sysrc hostname=VM2 \ |
| - | sysrc ifconfig_vtnet0=" | + | ifconfig_vtnet0=" |
| - | sysrc ifconfig_vtnet2=" | + | |
| - | sysrc static_routes="R5" | + | |
| - | sysrc route_R5=" | + | firewall_enable=YES |
| - | sysrc firewall_enable=YES | + | firewall_script="/ |
| - | sysrc firewall_script="/ | + | cat > / |
| - | + | ||
| - | cat > / | + | |
| #!/bin/sh | #!/bin/sh | ||
| fwcmd="/ | fwcmd="/ | ||
| 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 | ||
| </ | </ | ||
| Line 103: | Line 113: | ||
| === Router 3 === | === Router 3 === | ||
| - | Router 3 is configured for rate-limiting traffic at 10 Mb/s on interface to/ | + | Router 3 is configured for rate-limiting traffic at 10 Mb/s on interface to/ |
| < | < | ||
| - | sysrc hostname=R3 | + | sysrc hostname=VM3 \ |
| - | sysrc ifconfig_vtnet0=" | + | ifconfig_vtnet0=" |
| - | sysrc ifconfig_vtnet2=" | + | |
| - | sysrc static_routes="R5" | + | |
| - | sysrc route_R5=" | + | firewall_enable=YES |
| - | sysrc firewall_enable=YES | + | firewall_script="/ |
| - | sysrc firewall_script="/ | + | |
| - | cat > / | + | cat > / |
| #!/bin/sh | #!/bin/sh | ||
| fwcmd="/ | fwcmd="/ | ||
| 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 | ||
| </ | </ | ||
| Line 139: | Line 148: | ||
| === Router 4 === | === Router 4 === | ||
| - | Router 4 is the aggregating server' | + | Router 4 is configured for rate-limiting traffic at 10 Mb/s on interface to/from VM1. |
| < | < | ||
| - | sysrc hostname=R4 | + | sysrc hostname=VM4 \ |
| - | sysrc ifconfig_vtnet1=" | + | |
| - | sysrc ifconfig_vtnet2=" | + | |
| - | sysrc ifconfig_vtnet3=" | + | |
| - | sysrc static_routes="R2 R3" | + | |
| - | sysrc route_R2="-net 10.0.12.0/24 10.0.24.2" | + | |
| - | sysrc route_R3="-net 10.0.13.0/24 10.0.34.3" | + | |
| + | cat > / | ||
| + | #!/bin/sh | ||
| + | fwcmd="/ | ||
| + | kldstat | ||
| + | # 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 netif restart | ||
| service routing restart | service routing restart | ||
| + | service ipfw start | ||
| + | hostname VM4 | ||
| + | config save | ||
| + | </ | ||
| + | |||
| + | === Router 5 === | ||
| + | |||
| + | Router 5 is the aggregating server' | ||
| + | |||
| + | < | ||
| + | sysrc hostname=R5 \ | ||
| + | ifconfig_vtnet1=" | ||
| + | ifconfig_vtnet2=" | ||
| + | ifconfig_vtnet3=" | ||
| + | ifconfig_vtnet4=" | ||
| + | static_routes=" | ||
| + | route_ISP1=" | ||
| + | route_ISP2=" | ||
| + | route_ISP3=" | ||
| + | service netif restart | ||
| + | service routing restart | ||
| + | hostname VM5 | ||
| config save | config save | ||
| </ | </ | ||
| Line 156: | Line 203: | ||
| Router 1 is configured as a MLVPN client router connected to 3 different Internet links. | Router 1 is configured as a MLVPN client router connected to 3 different Internet links. | ||
| - | The big difference with MLPPP: We can't use 3 differents IP addresses on our server, then can't simply install 3 differents static routes. We need a 3 default routes, then a minimum of 4 differents routing table. | ||
| - | < | + | We need a default |
| - | sysrc hostname=R1 | + | |
| - | sysrc cloned_interfaces=" | + | |
| - | sysrc ifconfig_lo1=" | + | |
| - | sysrc ifconfig_vtnet0=" | + | |
| - | sysrc ifconfig_vtnet1=" | + | |
| - | sysrc static_routes=" | + | |
| - | sysrc route_ISP1=" | + | |
| - | sysrc route_ISP2=" | + | |
| - | sysrc mlvpn_enable=YES | + | |
| + | < | ||
| + | sysrc hostname=VM1 \ | ||
| + | cloned_interfaces=" | ||
| + | ifconfig_lo1=" | ||
| + | ifconfig_vtnet0=" | ||
| + | ifconfig_vtnet1=" | ||
| + | ifconfig_vtnet2=" | ||
| + | static_routes=" | ||
| + | route_ISP1=" | ||
| + | route_ISP2=" | ||
| + | route_ISP3=" | ||
| cat <<EOF > / | cat <<EOF > / | ||
| [general] | [general] | ||
| Line 175: | Line 223: | ||
| mtu = 1452 | mtu = 1452 | ||
| tuntap = " | tuntap = " | ||
| - | ip4 = "10.0.15.1/ | + | ip4 = "10.0.16.1/ |
| - | ip4_gateway = "10.0.15.5" | + | ip4_gateway = "10.0.16.2" |
| - | ip4_routes = "10.5.5.5/32" | + | ip4_routes = "10.6.6.6/32" |
| timeout = 30 | timeout = 30 | ||
| password = " | password = " | ||
| Line 187: | Line 235: | ||
| bindport = 5082 | bindport = 5082 | ||
| bindfib = 2 | bindfib = 2 | ||
| - | remotehost = "10.0.45.5" | + | remotehost = "10.0.56.6" |
| remoteport = 5082 | remoteport = 5082 | ||
| - | |||
| [dsl3] | [dsl3] | ||
| bindhost = " | bindhost = " | ||
| bindport = 5083 | bindport = 5083 | ||
| bindfib = 3 | bindfib = 3 | ||
| - | remotehost = "10.0.45.5" | + | remotehost = "10.0.56.6" |
| remoteport = 5083 | remoteport = 5083 | ||
| - | EOF | + | [dsl4] |
| + | bindhost = " | ||
| + | bindport = 5084 | ||
| + | bindfib = 4 | ||
| + | remotehost = " | ||
| + | remoteport = 5084 | ||
| + | EOF | ||
| + | service mlvpn enable | ||
| service netif restart | service netif restart | ||
| service routing restart | service routing restart | ||
| service mlvpn start | service mlvpn start | ||
| + | hostname VM1 | ||
| config save | config save | ||
| </ | </ | ||
| - | ==== Router | + | ==== Router |
| - | Router | + | Router |
| < | < | ||
| - | sysrc hostname=R5 | + | sysrc hostname=VM6 \ |
| - | sysrc cloned_interfaces=" | + | cloned_interfaces=" |
| - | sysrc ifconfig_lo1=" | + | ifconfig_lo1=" |
| - | sysrc ifconfig_vtnet3=" | + | |
| - | sysrc defaultrouter=10.0.45.4 | + | defaultrouter="10.0.56.5" |
| - | sysrc mlvpn_enable=YES | + | cat > / |
| - | + | ||
| - | cat <<' | + | |
| [general] | [general] | ||
| statuscommand = "/ | statuscommand = "/ | ||
| tuntap = " | tuntap = " | ||
| mode = " | mode = " | ||
| - | 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 = " | ip4_routes = " | ||
| timeout = 30 | timeout = 30 | ||
| Line 231: | Line 284: | ||
| [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 | ||
| - | ' | ||
| + | [adsl4] | ||
| + | bindhost = " | ||
| + | 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 | ||
| </ | </ | ||
| Line 313: | Line 373: | ||
| MLVPN can be started in debug mode: | MLVPN can be started in debug mode: | ||
| < | < | ||
| - | [root@R1]# mlvpn --debug -n mlvpn -u mlvpn | + | [root@VM1]~# mlvpn --debug -n mlvpn -u mlvpn --config / |
| - | 2016-04-19T23:48:21 [INFO/ | + | 2020-02-21T21:25:12 [INFO/ |
| - | 2016-04-19T23:48:21 [INFO/ | + | 2020-02-21T21:25:12 [INFO/ |
| - | 2016-04-19T23:48:21 [INFO/ | + | 2020-02-21T21:25:12 [INFO/ |
| - | 2016-04-19T23:48:21 [INFO] created interface `tun0' | + | 2020-02-21T21:25:12 [INFO/ |
| - | 2016-04-19T23:48:21 [INFO] dsl2 bind to 10.0.12.1 | + | 2020-02-21T21: |
| - | 2016-04-19T23:48:21 [INFO] dsl3 bind to 10.0.13.1 | + | 2020-02-21T21:25:12 [INFO] dsl2 bind to 10.0.12.1 |
| - | 2016-04-19T23:48:21 [INFO/ | + | 2020-02-21T21:25:12 [INFO] dsl3 bind to 10.0.13.1 |
| - | 2016-04-19T23:48:21 [INFO/ | + | 2020-02-21T21:25:12 [INFO] dsl4 bind to 10.0.14.1 |
| + | 2020-02-21T21: | ||
| + | 2020-02-21T21: | ||
| + | 2020-02-21T21:25:12 [INFO/ | ||
| </ | </ | ||
| tun interface need to be check (correct IP address and non-1500 MTU): | tun interface need to be check (correct IP address and non-1500 MTU): | ||
| < | < | ||
| - | [root@R1]# ifconfig tun0 | + | [root@VM1]~# ifconfig tun0 |
| tun0: flags=8051< | tun0: flags=8051< | ||
| options=80000< | options=80000< | ||
| - | inet6 fe80:: | + | inet6 fe80:: |
| - | inet 10.0.15.1 --> 10.0.15.5 netmask 0xfffffffc | + | inet 10.0.16.1 --> 10.0.16.2 netmask 0xfffffffc |
| + | groups: tun | ||
| nd6 options=21< | nd6 options=21< | ||
| - | Opened by PID 2326 | + | Opened by PID 92891 |
| </ | </ | ||
| And static route(s) needs to be installed (10.5.5.5/ | And static route(s) needs to be installed (10.5.5.5/ | ||
| < | < | ||
| - | [root@R1]~# netstat -rn4 | + | [root@VM1]~# route get 10.6.6.6 |
| - | Routing tables | + | route to: 10.6.6.6 |
| - | + | destination: | |
| - | Internet: | + | mask: 255.255.255.255 |
| - | Destination | + | |
| - | 10.0.12.0/24 | + | fib: 0 |
| - | 10.0.13.0/24 | + | interface: |
| - | 10.0.15.1 link# | + | |
| - | 10.0.15.5 link# | + | |
| - | 10.5.5.5/32 10.0.15.5 UGS | + | 0 |
| - | 127.0.0.1 | + | |
| </ | </ | ||
| ==== Aggregated bandwidth ==== | ==== Aggregated bandwidth ==== | ||
| - | Check that aggregated bandwitdh is 10+10 = 20Mbit/s on this lab. | + | Check that aggregated bandwitdh is 10+10+10 = 30Mbit/s on this lab. |
| < | < | ||
| - | [root@R1]# iperf --bind 10.1.1.1 -c 10.5.5.5 -t 60 | + | [root@VM1]~# iperf3 |
| - | ------------------------------------------------------------ | + | (...) |
| - | Client connecting to 10.5.5.5, TCP port 5001 | + | [ ID] Interval |
| - | Binding to local address 10.1.1.1 | + | [ |
| - | TCP window size: 32.3 KByte (default) | + | [ |
| - | ------------------------------------------------------------ | + | |
| - | [ | + | |
| - | [ ID] Interval | + | |
| - | [ | + | |
| </ | </ | ||
| + | |||
| + | Ouch, not the expected performance :-( | ||
documentation/examples/aggregating_multiple_isp_links_with_mlvpn.1582316679.txt.gz · Last modified: 2020/02/21 21:24 by olivier
