Skip to content

Instantly share code, notes, and snippets.

@yasuoka
Last active September 7, 2019 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yasuoka/7a9ae7218a91b3544bae0ae9f2e594e1 to your computer and use it in GitHub Desktop.
Save yasuoka/7a9ae7218a91b3544bae0ae9f2e594e1 to your computer and use it in GitHub Desktop.
Test cases for npppd

Test PPPoE on a standalone OpenBSD

This test

  • assumes /etc/npppd/npppd.conf is kept the original.
    • uses 10.0.0.0/24 for pool address for npppd
  • uses rdomain 1 for client PPPoE
  1. System configuraions

    $ doas sysctl net.inet.ip.forwarding=1
    $ doas sysctl net.pipex.enable=1
    
  2. Create pair(4) interfaces for test

    $ doas ifconfig pair0 up
    $ doas ifconfig pair1 patch pair0 up
    
  3. Append the following setting to /etc/npppd/npppd.conf

    tunnel PPPoE protocol pppoe {
        listen on interface pair0
    }
    bind tunnel from PPPoE authenticated by LOCAL to pppx0
    
  4. Create a test user "test" with password "hogehoge"

    $ echo "test:password=hogehoge:" | doas tee -a /etc/npppd/npppd-users
    
  5. Start npppd

    $ doas npppd -dd
    
  6. Start pppoe0

    $ doas ifconfig pppoe0 rdomain 1 0.0.0.0/32 0.0.0.1 \
        pppoedev pair1 authproto chap authname test authkey hogehoge up
    
  7. Test if success

    $ npppctl session brief
    Ppp Id     Assigned IPv4   Username             Proto Tunnel From
    ---------- --------------- -------------------- ----- -------------------------
             0 10.0.0.89       test                 PPPoE fe:e1:ba:d1:48:74
    $
    $ ping -V1 -w 3 -c 1 10.0.0.1
    PING 10.0.0.1 (10.0.0.1): 56 data bytes
    64 bytes from 10.0.0.1: icmp_seq=0 ttl=255 time=22.096 ms
    --- 10.0.0.1 ping statistics ---
    1 packets transmitted, 1 packets received, 0.0% packet loss
    round-trip min/avg/max/std-dev = 22.096/22.096/22.096/0.000 ms
    $
    
    (If network is ready and the other required configurations are done)
    $ doas route -T1 add default 10.0.0.1
    add net default: gateway 10.0.0.1
    $
    $ ping -V1 -w 3 -c 1 8.8.8.8
    PING 8.8.8.8 (8.8.8.8): 56 data bytes
    64 bytes from 8.8.8.8: icmp_seq=0 ttl=51 time=16.114 ms
    
    --- 8.8.8.8 ping statistics ---
    1 packets transmitted, 1 packets received, 0.0% packet loss
    round-trip min/avg/max/std-dev = 16.114/16.114/16.114/0.000 ms
    $
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment