User Tools

Site Tools


documentation:examples:pppoe_and_l2tp_lab

Differences

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

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
documentation:examples:pppoe_and_l2tp_lab [2017/07/07 00:18] – external edit 127.0.0.1documentation:examples:pppoe_and_l2tp_lab [2021/04/01 11:44] – [Router 3 : LNS (L2TP server)] olivier
Line 11: Line 11:
 {{:documentation:examples:bsdrp-example-pppoe-l2tp.png|}} {{:documentation:examples:bsdrp-example-pppoe-l2tp.png|}}
  
-===== Preparing =====+==== Setting-up a virtual lab ====
  
-This chapter will describe how to start each routers.+=== Downloading BSD Router Project images ===
  
-==== Downloading BSD Router Project images ====+Download BSDRP serial image (prevent to have to use an X display) on Sourceforge.
  
-[[http://bsdrp.net/downloads | Download BSDRP a serial image]] for avoiding to have to use an X display. +=== Download Lab scripts ====
- +
-==== Download Qemu/Virtualbox Lab scripts =====+
  
 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]].
  
-==== Starting the lab =====+Start the lab with full-meshed 5 routers and one shared LAN, on this example using bhyve lab script on FreeBSD:
  
-=== Using Qemu === +<code> 
-Start the Qemu based lab with this command: +# tools/BSDRP-lab-bhyve.sh -i workdir/BSDRP.amd64/BSDRP-n257626-full-amd64-serial.img.xz -n 4 
- +BSD Router Project (http://bsdrp.net) - bhyve full-meshed lab script 
-<code>./qemu.sh -i BSDRP_0.35_full_i386_serial.img -n 4</code> +Setting-up a virtual lab with 4 VM(s): 
- +- Working directory: /root/BSDRP-VMs 
-The output should be like that: +- Each VM has a total of 1 (1 cores and 1 threads) and 512M RAM 
- +- Emulated NIC: virtio-net 
-<code>BSD Router Project: Qemu lab script +- Switch mode: bridge + tap 
-(etc...+- 0 LAN(s) between all VM 
-Router1 have the folllowing NIC: +- Full mesh Ethernet links between each VM 
-em0 connected to Router2. +VM 1 has the following NIC: 
-em1 connected to Router3. +- vtnet0 connected to VM 2 
-em2 connected to Router4. +- vtnet1 connected to VM 3 
-Connect to the router 1 by telneting to localhost on port 8001 +- vtnet2 connected to VM 4 
-Router2 have the folllowing NIC: +VM 2 has the following NIC: 
-em0 connected to Router1. +- vtnet0 connected to VM 1 
-em1 connected to Router3. +- vtnet1 connected to VM 3 
-em2 connected to Router4. +- vtnet2 connected to VM 4 
-Connect to the router 2 by telneting to localhost on port 8002 +VM 3 has the following NIC: 
-Router3 have the folllowing NIC: +- vtnet0 connected to VM 1 
-em0 connected to Router1. +- vtnet1 connected to VM 2 
-em1 connected to Router2. +- vtnet2 connected to VM 4 
-em2 connected to Router4. +VM 4 has the following NIC: 
-Connect to the router 3 by telneting to localhost on port 8003 +- vtnet0 connected to VM 1 
-Router4 have the folllowing NIC: +- vtnet1 connected to VM 2 
-em0 connected to Router1. +- vtnet2 connected to VM 3 
-em1 connected to Router2. +To connect VM'serial console, you can use: 
-em2 connected to Router3+- VM 1 : cu -l /dev/nmdm-BSDRP.1B 
-Connect to the router by telneting to localhost on port 8004+- VM 2 : cu -l /dev/nmdm-BSDRP.2B 
 +- VM 3 : cu -l /dev/nmdm-BSDRP.3B 
 +- VM : cu -l /dev/nmdm-BSDRP.4B
 </code> </code>
  
-=== Using Virtualbox === 
  
-Start the Virtualbox based lab with this command: 
  
-<code>./virtualbox.sh -i BSDRP_0.35_full_i386_serial.img -n 4</code> 
  
-The output should be like that: 
- 
-<code> 
-BSD Router Project VirtualBox lab script 
-(etc...) 
-Router1 have the folllowing NIC: 
-em0 connected to Router2. 
-em1 connected to Router3. 
-em2 connected to Router4. 
-Router2 have the folllowing NIC: 
-em0 connected to Router1. 
-em1 connected to Router3. 
-em2 connected to Router4. 
-Router3 have the folllowing NIC: 
-em0 connected to Router1. 
-em1 connected to Router2. 
-em2 connected to Router4. 
-Router4 have the folllowing NIC: 
-em0 connected to Router1. 
-em1 connected to Router2. 
-em2 connected to Router3. 
-Connect to the router 1 by telneting to localhost on port 8001 
-Connect to the router 2 by telneting to localhost on port 8002 
-Connect to the router 3 by telneting to localhost on port 8003 
-Connect to the router 4 by telneting to localhost on port 8004 
-</code> 
  
 ===== Routers configuration ===== ===== Routers configuration =====
  
-==== Router 1 ==== 
  
-Router 1 is configured as a simple workstation PPPoE client.+==== Router BAS and LAC ====
  
-Note: There is no IP address configured on the ethernet interface.+Router 2 forwards PPP between PPPoE and L2TP.
  
-=== Modify configuration === 
  
-Configure global parameters: 
-<code> 
-sysrc hostname=R1 
-sysrc gateway_enable=NO 
-sysrc ipv6_gateway_enable=NO 
-sysrc mpd_enable=YES 
-sysrc mpd_flags="-b -s ppp" 
-</code> 
- 
-Configure mpd: 
- 
-<code> 
-cat > /usr/local/etc/mpd5/mpd.conf <<'EOF' 
-default: 
-        create bundle static B1 
-        set bundle enable ipv6cp 
-        set ipcp enable req-pri-dns   
-        set ipcp enable req-sec-dns   
-        set iface route default 
-        create link static L1 pppoe 
-        set link action bundle B1 
-        set auth authname olivier 
-        set auth password secret 
-        set pppoe iface em0 
-        open 
-'EOF' 
-</code> 
- 
-And apply your changes: 
- 
-<code> 
-service netif restart 
-service routing restart 
-service mpd5 start 
-config save 
-</code> 
- 
-==== Router 2 ==== 
- 
-Router 2 is configured as a BAS and LAC (forward PPP between PPPoE and L2TP). 
- 
-=== Modify configuration === 
- 
-Set the base parameters: 
 <code> <code>
 sysrc hostname=R2 sysrc hostname=R2
-sysrc ifconfig_em1="10.0.23.2/24"+sysrc ifconfig_vtnet1="10.0.23.2/24"
 sysrc mpd_enable=YES sysrc mpd_enable=YES
 sysrc mpd_flags="-b -s ppp" sysrc mpd_flags="-b -s ppp"
-</code> 
- 
-Configure mpd5: 
- 
-<code> 
 cat > /usr/local/etc/mpd5/mpd.conf <<'EOF' cat > /usr/local/etc/mpd5/mpd.conf <<'EOF'
 default: default:
         create link template L1 pppoe         create link template L1 pppoe
-        set pppoe iface em0+        set pppoe iface vtnet0
         set link action forward L2         set link action forward L2
         set link enable incoming         set link enable incoming
Line 162: Line 82:
         set l2tp peer 10.0.23.3         set l2tp peer 10.0.23.3
 'EOF' 'EOF'
-</code> 
- 
-And apply your changes: 
- 
-<code> 
 service netif restart service netif restart
 service routing restart service routing restart
Line 173: Line 88:
 </code> </code>
  
-==== Router 3 ==== +==== Router 3 LNS (L2TP server) ====
- +
-Router 3 is configured as a LNS (L2TP server)+
- +
-==Modify configuration ===+
  
-Set the global parameters: 
 <code> <code>
 sysrc hostname=R3 sysrc hostname=R3
-sysrc ifconfig_em1="10.0.23.3/24" +sysrc ifconfig_vtnet1="10.0.23.3/24" 
-sysrc ifconfig_em2="88.88.88.4/24"+sysrc ifconfig_vtnet2="88.88.88.4/24"
 sysrc mpd_enable=YES sysrc mpd_enable=YES
 sysrc mpd_flags="-b -s ppp" sysrc mpd_flags="-b -s ppp"
-</code> 
- 
-Configure mpd5: 
- 
-<code> 
 cat > /usr/local/etc/mpd5/mpd.conf <<'EOF' cat > /usr/local/etc/mpd5/mpd.conf <<'EOF'
 default: default:
Line 206: Line 111:
         set link enable incoming         set link enable incoming
 'EOF' 'EOF'
-</code> 
- 
-Set the password: 
- 
-<code> 
 cat > /usr/local/etc/mpd5/mpd.secret <<'EOF' cat > /usr/local/etc/mpd5/mpd.secret <<'EOF'
 olivier         secret olivier         secret
 'EOF' 'EOF'
 +service netif restart
 +service routing restart
 +service mpd5 start
 +config save
 </code> </code>
  
-And apply your changes:+==== Router 1 : PPPoE client ====
  
 <code> <code>
 +sysrc hostname=R1
 +sysrc gateway_enable=NO
 +sysrc ipv6_gateway_enable=NO
 +sysrc mpd_enable=YES
 +sysrc mpd_flags="-b -s ppp"
 +cat > /usr/local/etc/mpd5/mpd.conf <<'EOF'
 +default:
 +        create bundle static B1
 +        set bundle enable ipv6cp
 +        set ipcp enable req-pri-dns  
 +        set ipcp enable req-sec-dns  
 +        set iface route default
 +        create link static L1 pppoe
 +        set link action bundle B1
 +        set auth authname olivier
 +        set auth password secret
 +        set pppoe iface vtnet0
 +        open
 +'EOF'
 service netif restart service netif restart
 service routing restart service routing restart
Line 229: Line 152:
 Router 4 is configured as simple host, and be used an Internet server too for testing connectivity with the PC. Router 4 is configured as simple host, and be used an Internet server too for testing connectivity with the PC.
  
-=== Modify configuration === 
- 
-Set the basic parameters: 
 <code> <code>
 sysrc hostname=R4 sysrc hostname=R4
 sysrc defaultrouter="88.88.88.4" sysrc defaultrouter="88.88.88.4"
-sysrc ifconfig_em2="88.88.88.5/24"+sysrc ifconfig_vtnet2="88.88.88.5/24" 
 +sysrc gateway_enable=NO 
 +sysrc ipv6_gateway_enable=NO
 service netif restart service netif restart
 service routing restart service routing restart
documentation/examples/pppoe_and_l2tp_lab.txt · Last modified: 2021/04/01 11:51 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