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

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
documentation:examples:pppoe_and_l2tp_lab [2021/04/01 11:32] – [Preparing] olivierdocumentation:examples:pppoe_and_l2tp_lab [2021/04/01 11:47] – [LAC (R2)] olivier
Line 10: Line 10:
  
 {{:documentation:examples:bsdrp-example-pppoe-l2tp.png|}} {{:documentation:examples:bsdrp-example-pppoe-l2tp.png|}}
 +
 +==== Setting-up a virtual lab ====
  
 === Downloading BSD Router Project images === === Downloading BSD Router Project images ===
Line 22: Line 24:
  
 <code> <code>
-todo+# 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 
 +Setting-up a virtual lab with 4 VM(s): 
 +- Working directory: /root/BSDRP-VMs 
 +- Each VM has a total of 1 (1 cores and 1 threads) and 512M RAM 
 +- Emulated NIC: virtio-net 
 +- Switch mode: bridge + tap 
 +- 0 LAN(s) between all VM 
 +- Full mesh Ethernet links between each VM 
 +VM 1 has the following NIC: 
 +- vtnet0 connected to VM 2 
 +- vtnet1 connected to VM 3 
 +- vtnet2 connected to VM 4 
 +VM 2 has the following NIC: 
 +- vtnet0 connected to VM 1 
 +- vtnet1 connected to VM 3 
 +- vtnet2 connected to VM 4 
 +VM 3 has the following NIC: 
 +- vtnet0 connected to VM 1 
 +- vtnet1 connected to VM 2 
 +- vtnet2 connected to VM 4 
 +VM 4 has the following NIC: 
 +- vtnet0 connected to VM 1 
 +- vtnet1 connected to VM 2 
 +- vtnet2 connected to VM 3 
 +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
 </code> </code>
  
-==== Downloading BSD Router Project images ==== 
  
-[[http://bsdrp.net/downloads | Download BSDRP a serial image]] for avoiding to have to use an X display. 
  
-==== Download Qemu/Virtualbox Lab scripts ===== 
  
-More information on these BSDRP lab scripts available on [[documentation:examples:How to build a BSDRP router lab]]. 
- 
-==== Starting the lab ===== 
- 
-=== Using Qemu === 
-Start the Qemu based lab with this command: 
- 
-<code>./qemu.sh -i BSDRP_0.35_full_i386_serial.img -n 4</code> 
- 
-The output should be like that: 
- 
-<code>BSD Router Project: Qemu lab script 
-(etc...) 
-Router1 have the folllowing NIC: 
-em0 connected to Router2. 
-em1 connected to Router3. 
-em2 connected to Router4. 
-Connect to the router 1 by telneting to localhost on port 8001 
-Router2 have the folllowing NIC: 
-em0 connected to Router1. 
-em1 connected to Router3. 
-em2 connected to Router4. 
-Connect to the router 2 by telneting to localhost on port 8002 
-Router3 have the folllowing NIC: 
-em0 connected to Router1. 
-em1 connected to Router2. 
-em2 connected to Router4. 
-Connect to the router 3 by telneting to localhost on port 8003 
-Router4 have the folllowing NIC: 
-em0 connected to Router1. 
-em1 connected to Router2. 
-em2 connected to Router3. 
-Connect to the router 4 by telneting to localhost on port 8004 
-</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. 
- 
-Note: There is no IP address configured on the ethernet interface. 
- 
-=== 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 : BAS and LAC ====
  
-Router 2 is configured as a BAS and LAC (forward PPP between PPPoE and L2TP).+Router 2 forwards 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 172: 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 183: 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 216: 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 239: 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
Line 394: Line 306:
 <code> <code>
 cat /var/log/ppp.log                                                                                                                           cat /var/log/ppp.log                                                                                                                          
-Mar  8 10:55:34 R2 newsyslog[1004]: logfile first created +Apr  11:47:11 R2 ppp[54126]: Incoming PPPoE connection request via vtnet0: for service "*" from 58:9c:fc:01:02:01 
-Mar  8 11:36:05 R2 ppp: Multi-link PPP daemon for FreeBSD +Apr  11:47:11 R2 ppp[54126]: [L1-2] Accepting PPPoE connection 
-Mar  8 11:36:05 R2 ppp:   +Apr  11:47:11 R2 ppp[54126]: [L1-2] Link: Matched action 'forward "L2"' 
-Mar  8 11:36:05 R2 ppp: process 3432 started, version 5.5 (root@bigdev.bsdrp.net 04:44  3-Apr-2011) +Apr  11:47:11 R2 ppp[54126]: [R-L1-2] Rep: INCOMING event from L1-2 (0) 
-Mar  11:36:05 R2 ppp: Label 'startup' not found +Apr  11:47:11 R2 ppp[54126]: L2TP: Initiating control connection 0x801e2d610 0.0.0.0 0 <-> 10.0.23.3 1701 
-Mar  8 11:36:05 R2 ppp: PPPoE: waiting for connection on em0:, service "*" +Apr  11:47:11 R2 ppp[54126]: [L1-2] PPPoE: connection successful 
-Mar  8 11:37:36 R2 ppp: Incoming PPPoE connection request via em0: for service "*" from aa:aa:00:00:01:12 +Apr  11:47:11 R2 ppp[54126]: L2TP: Control connection 0x801e2d610 10.0.23.2 31124 <-> 10.0.23.3 1701 connected 
-Mar  11:37:36 R2 ppp: [L1-2] Accepting PPPoE connection +Apr  11:47:11 R2 ppp[54126]: [L2-3] L2TP: Incoming call #1650000 via control connection 0x801e2d610 initiated 
-Mar  11:37:36 R2 ppp: [L1-2] Link: Matched action 'forward "L2"' +Apr  11:47:11 R2 ppp[54126]: [L2-3] L2TP: Call #1650000 connected 
-Mar  11:37:36 R2 ppp: [R-L1-2] Rep: INCOMING event from L1-2 (0) +Apr  11:47:11 R2 ppp[54126]: [R-L1-2] Rep: UP event from L2-3 (1) 
-Mar  11:37:36 R2 ppp: L2TP: Initiating control connection 0x801c8d110 0.0.0.0 0 <-> 10.0.23.3 1701 +Apr  11:47:11 R2 ppp[54126]: [R-L1-2] Rep: UP event from L1-2 (0)
-Mar  11:37:36 R2 ppp: [L1-2] PPPoE: connection successful +
-Mar  11:37:36 R2 ppp: L2TP: Control connection 0x801c8d110 10.0.23.2 37619 <-> 10.0.23.3 1701 connected +
-Mar  11:37:36 R2 ppp: [L2-3] L2TP: Incoming call #6190000 via control connection 0x801c8d110 initiated +
-Mar  11:37:36 R2 ppp: [L2-3] L2TP: Call #6190000 connected +
-Mar  11:37:36 R2 ppp: [R-L1-2] Rep: UP event from L2-3 (1) +
-Mar  11:37:36 R2 ppp: [R-L1-2] Rep: UP event from L1-2 (0)+
 </code> </code>
  
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