SlideShare a Scribd company logo
4
Most read
5
Most read
6
Most read
Npppd: easy vpn with OpenBSD

            Giovanni Bechis
        giovanni@openbsd.org




Institute of Biostructures and Bioimaging,
                Napoli, Italy
                Apr 6, 2013
A little presentation




       sysadmin and web developer at SnB, my own software house
       developer for OpenBSD
       every now and then, developer for some other open source
       software
The initial problem



       two offices and some people with their laptop who wish to use
       their main software remotely
The proposed solution

      the two offices has been connected to a Windows Server in a
      web farm with the terminal server connections protected by a
      vpn
Vpn software




      Vpn software that could be used for this setup on our
      OpenBSD firewall:
      iked(8)
      openvpn
      poptop
      npppd(8)
npppd(8) main features




      it is a PPP and tunneling daemon which supports PPTP,
      L2TP and PPPoE
      it can authenticate using a local file or a remote radius server
      it can use pipex(4) to accelerate ip packets forwarding
      it can use tun(4) or pppx(4) interfaces to tunnel packets
npppd(8) short story




      npppd(8) has been initially developed by IIJ
      it first appeared in OpenBSD 5.3
npppd(8) configuration




      the configuration file is /etc/npppd/npppd.conf
      the configuration file format has changed a lot during
      development
npppd.conf(5)
   ”Basic” npppd(8) configuration


   authentication LOCAL type local {
       users-file "/etc/npppd/npppd-users"
   }

   tunnel PPTP_ipv4 protocol pptp {
       listen on 0.0.0.0
   }

   ipcp IPCP {
       pool-address 10.0.0.2-10.0.0.100
       dns-servers 192.168.0.254
   }

   interface pppx0 address 10.0.0.1 ipcp IPCP
   bind tunnel from PPTP_ipv4 authenticated by LOCAL to pppx0
npppd-users(5)



   npppd-users(5) file format


   alex:
            :password=alex’s password:
            :framed-ip-address=10.0.0.33:
   john:
            :password=john’s password:
npppd.conf(5)
   ”Advanced” npppd(8) configuration


   authentication RADIUS type radius {
       authentication-server {
           address 192.168.0.1 secret "hogehoge"
       }
   }

   tunnel L2TP_ipv4 protocol l2tp {
       listen on 0.0.0.0
   }
   ipcp IPCP {
       pool-address 10.0.0.2-10.0.0.100
       dns-servers 192.168.0.254
   }

   interface pppx0 address 10.0.0.1 ipcp IPCP
   bind tunnel from L2TP_ipv4 authenticated by RADIUS to pppx0
l2tp setup




       to setup an l2tp tunnel you have to configure both npppd.conf
       and ipsec.conf
       your pf.conf setup should be changed accordingly
ipsec.conf(5)



   Ipsec setup for l2tp tunnels


   public_ip = "1.2.3.4"
   ike passive esp transport 
           proto udp from $public_ip to any port 1701 
           main auth "hmac-sha1" enc "aes" group modp2048 
           quick auth "hmac-sha1" enc "3des" 
           psk "mysecret"
pf.conf(5)




   Pf setup for l2tp tunnels


   pass quick proto { esp, ah } from any to any
   pass in quick on egress proto udp from any to any 
       port {500, 4500, 1701} keep state
   pass on enc0 from any to any keep state (if-bound)
npppd monitoring
   To monitor npppd vpn sessions you can use npppctl

   # npppctl session all
   Ppp Id = 18
             Ppp Id                    :   18
             Username                  :   giovanni
             Realm Name                :   radius
             Concentrated Interface    :   tun1
             Assigned IPv4 Address     :   192.168.255.205
             Tunnel Protocol           :   PPTP
             Tunnel From               :   151.71.144.16:31342
             Start Time                :   2013/02/04 11:35:24
             Elapsed Time              :   131 sec (2 minutes)
             Input Bytes               :   11256 (11.0 KB)
             Input Packets             :   130
             Input Errors              :   0 (0.0%)
             Output Bytes              :   19241 (18.8 KB)
             Output Packets            :   160
             Output Errors             :   17 (9.6%)
npppd monitoring


   If you use pppx(4) interfaces you can have some info from the
   ifconfig command too


   # ifconfig pppx0
   pppx0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1360
           description: giovanni
           priority: 0
           groups: pppx
           inet 192.168.255.1 --> 192.168.255.205 
           netmask 0xffffffff
npppd monitoring
   As usual, with ipsec, ipsecctl is your friend


   # ipsecctl -s all
   FLOWS:
   flow esp in proto udp from 9.2.71.195 port l2tp 
       to 192.168.2.250 port l2tp peer 9.2.71.195 
       srcid 192.168.2.250/32 dstid 192.168.1.101/32 type use
   flow esp out proto udp from 192.168.2.250 port l2tp 
       to 9.2.71.195 port l2tp peer 9.2.71.195 
       srcid 192.168.2.250/32 dstid 192.168.1.101/32 type require

   SAD:
   esp transport from     192.168.2.250 to 9.2.71.195 
        spi 0x41f46e6a    auth hmac-sha1 enc aes
   esp transport from     9.2.71.195 to 192.168.2.250 
        spi 0x6d7d8716    auth hmac-sha1 enc aes
Vpn gui interface
Vpn gui interface
Vpn gui interface
Microsoft tips and Microsoft bugs

   Microsoft, dns, kerberos and mtu
Microsoft tips and bugs




   ipsec nat-t support


   Windows Registry Editor Version 5.00

   [HKLMSYSTEMCurrentControlSetServicesPolicyAgent]
   "AssumeUDPEncapsulationContextOnSendRule"=dword:00000002
npppd future




      fixing bugs
      better integration with pf
      arp cache support
Thank you for your attention!




          Questions?

More Related Content

PPTX
How Secure are IPsec and SSL VPN encryptions
PPT
Tunnel & vpn1
PDF
VPN - Virtual Private Network
PPT
Cisco Router As A Vpn Server
PPT
Vpn(4)
PDF
Overview of SCTP (Stream Control Transmission Protocol)
PPTX
GRE (Generic Routing Encapsulation)
PPTX
Network tunneling techniques
How Secure are IPsec and SSL VPN encryptions
Tunnel & vpn1
VPN - Virtual Private Network
Cisco Router As A Vpn Server
Vpn(4)
Overview of SCTP (Stream Control Transmission Protocol)
GRE (Generic Routing Encapsulation)
Network tunneling techniques

What's hot (19)

PPTX
Multipath TCP
PPTX
VPN presentation
PPTX
Types of VPN
PPT
Cisco Certified Network Associate
PPTX
Solving QoS multicast routing problem using aco algorithm
PPTX
6lowpan 110828234426-phpapp01
PPTX
Multipath TCP as Security Solution
PDF
Dotnet network prog_chap07
PDF
XMPP, HTTP and UPnP
PDF
Paper id 25201418
PPT
internetworking operation
PDF
NAT (network address translation) & PAT (port address translation)
PDF
Iptables presentation
PPT
Introduction P2p
PPT
PDF
TCP over 6LoWPAN for Industrial Applications
PDF
6 Lo Wpan Tutorial 20080206
Multipath TCP
VPN presentation
Types of VPN
Cisco Certified Network Associate
Solving QoS multicast routing problem using aco algorithm
6lowpan 110828234426-phpapp01
Multipath TCP as Security Solution
Dotnet network prog_chap07
XMPP, HTTP and UPnP
Paper id 25201418
internetworking operation
NAT (network address translation) & PAT (port address translation)
Iptables presentation
Introduction P2p
TCP over 6LoWPAN for Industrial Applications
6 Lo Wpan Tutorial 20080206
Ad

Similar to Npppd: easy vpn with OpenBSD (20)

PDF
Tutorial of SF-TAP Flow Abstractor
PDF
Linux Networking Explained
PPTX
[오픈소스컨설팅] Linux Network Troubleshooting
PPT
Александр Зайцев - Port Knocking, short notes
PDF
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
PDF
FreeBSD VPN Server
PPT
13048671.ppt
PDF
NUSE (Network Stack in Userspace) at #osio
PDF
Nxll22 role based cli
PDF
3 scanning-ger paoctes-pub
PDF
Eincop Netwax Lab: HSRP (Hot Standby Router Protocol)
PDF
Pcapy and dpkt - tcpdump on steroids - Ran Leibman - DevOpsDays Tel Aviv 2018
PDF
MPLS LAB Practice Vol.1.pdf
PDF
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)
PDF
FreeBSD, ipfw and OpenVPN 2.1 server
PDF
Openvpn
DOCX
Certified Ethical Hacker quick test prep cheat sheet
PPTX
NMAP - The Network Scanner
PDF
FD.io - The Universal Dataplane
PDF
IL: 失われたプロトコル
Tutorial of SF-TAP Flow Abstractor
Linux Networking Explained
[오픈소스컨설팅] Linux Network Troubleshooting
Александр Зайцев - Port Knocking, short notes
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
FreeBSD VPN Server
13048671.ppt
NUSE (Network Stack in Userspace) at #osio
Nxll22 role based cli
3 scanning-ger paoctes-pub
Eincop Netwax Lab: HSRP (Hot Standby Router Protocol)
Pcapy and dpkt - tcpdump on steroids - Ran Leibman - DevOpsDays Tel Aviv 2018
MPLS LAB Practice Vol.1.pdf
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)
FreeBSD, ipfw and OpenVPN 2.1 server
Openvpn
Certified Ethical Hacker quick test prep cheat sheet
NMAP - The Network Scanner
FD.io - The Universal Dataplane
IL: 失われたプロトコル
Ad

More from Giovanni Bechis (20)

PDF
the Apache way
PDF
SpamAssassin 4.0 new features
PDF
ACME and mod_md: tls certificates made easy
PDF
Scaling antispam solutions with Puppet
PDF
What's new in SpamAssassin 3.4.3
PDF
Fighting Spam for fun and profit
PDF
Linux seccomp(2) vs OpenBSD pledge(2)
PDF
Pledge in OpenBSD
PDF
Pf: the OpenBSD packet filter
PDF
ELK: a log management framework
PDF
OpenSSH: keep your secrets safe
PDF
OpenSMTPD: we deliver !!
PDF
LibreSSL, one year later
PDF
LibreSSL
PDF
SOGo: sostituire Microsoft Exchange con software Open Source
PDF
Cloud storage, i tuoi files, ovunque con te
PDF
Openssh: comunicare in sicurezza
PDF
Ipv6: il futuro di internet
PDF
L'ABC della crittografia
PDF
Relayd: a load balancer for OpenBSD
the Apache way
SpamAssassin 4.0 new features
ACME and mod_md: tls certificates made easy
Scaling antispam solutions with Puppet
What's new in SpamAssassin 3.4.3
Fighting Spam for fun and profit
Linux seccomp(2) vs OpenBSD pledge(2)
Pledge in OpenBSD
Pf: the OpenBSD packet filter
ELK: a log management framework
OpenSSH: keep your secrets safe
OpenSMTPD: we deliver !!
LibreSSL, one year later
LibreSSL
SOGo: sostituire Microsoft Exchange con software Open Source
Cloud storage, i tuoi files, ovunque con te
Openssh: comunicare in sicurezza
Ipv6: il futuro di internet
L'ABC della crittografia
Relayd: a load balancer for OpenBSD

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Big Data Technologies - Introduction.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
Teaching material agriculture food technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Programs and apps: productivity, graphics, security and other tools
Reach Out and Touch Someone: Haptics and Empathic Computing
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
sap open course for s4hana steps from ECC to s4
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
The AUB Centre for AI in Media Proposal.docx
Review of recent advances in non-invasive hemoglobin estimation
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Unlocking AI with Model Context Protocol (MCP)
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Big Data Technologies - Introduction.pptx
Approach and Philosophy of On baking technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
Teaching material agriculture food technology
MIND Revenue Release Quarter 2 2025 Press Release
Programs and apps: productivity, graphics, security and other tools

Npppd: easy vpn with OpenBSD

  • 1. Npppd: easy vpn with OpenBSD Giovanni Bechis giovanni@openbsd.org Institute of Biostructures and Bioimaging, Napoli, Italy Apr 6, 2013
  • 2. A little presentation sysadmin and web developer at SnB, my own software house developer for OpenBSD every now and then, developer for some other open source software
  • 3. The initial problem two offices and some people with their laptop who wish to use their main software remotely
  • 4. The proposed solution the two offices has been connected to a Windows Server in a web farm with the terminal server connections protected by a vpn
  • 5. Vpn software Vpn software that could be used for this setup on our OpenBSD firewall: iked(8) openvpn poptop npppd(8)
  • 6. npppd(8) main features it is a PPP and tunneling daemon which supports PPTP, L2TP and PPPoE it can authenticate using a local file or a remote radius server it can use pipex(4) to accelerate ip packets forwarding it can use tun(4) or pppx(4) interfaces to tunnel packets
  • 7. npppd(8) short story npppd(8) has been initially developed by IIJ it first appeared in OpenBSD 5.3
  • 8. npppd(8) configuration the configuration file is /etc/npppd/npppd.conf the configuration file format has changed a lot during development
  • 9. npppd.conf(5) ”Basic” npppd(8) configuration authentication LOCAL type local { users-file "/etc/npppd/npppd-users" } tunnel PPTP_ipv4 protocol pptp { listen on 0.0.0.0 } ipcp IPCP { pool-address 10.0.0.2-10.0.0.100 dns-servers 192.168.0.254 } interface pppx0 address 10.0.0.1 ipcp IPCP bind tunnel from PPTP_ipv4 authenticated by LOCAL to pppx0
  • 10. npppd-users(5) npppd-users(5) file format alex: :password=alex’s password: :framed-ip-address=10.0.0.33: john: :password=john’s password:
  • 11. npppd.conf(5) ”Advanced” npppd(8) configuration authentication RADIUS type radius { authentication-server { address 192.168.0.1 secret "hogehoge" } } tunnel L2TP_ipv4 protocol l2tp { listen on 0.0.0.0 } ipcp IPCP { pool-address 10.0.0.2-10.0.0.100 dns-servers 192.168.0.254 } interface pppx0 address 10.0.0.1 ipcp IPCP bind tunnel from L2TP_ipv4 authenticated by RADIUS to pppx0
  • 12. l2tp setup to setup an l2tp tunnel you have to configure both npppd.conf and ipsec.conf your pf.conf setup should be changed accordingly
  • 13. ipsec.conf(5) Ipsec setup for l2tp tunnels public_ip = "1.2.3.4" ike passive esp transport proto udp from $public_ip to any port 1701 main auth "hmac-sha1" enc "aes" group modp2048 quick auth "hmac-sha1" enc "3des" psk "mysecret"
  • 14. pf.conf(5) Pf setup for l2tp tunnels pass quick proto { esp, ah } from any to any pass in quick on egress proto udp from any to any port {500, 4500, 1701} keep state pass on enc0 from any to any keep state (if-bound)
  • 15. npppd monitoring To monitor npppd vpn sessions you can use npppctl # npppctl session all Ppp Id = 18 Ppp Id : 18 Username : giovanni Realm Name : radius Concentrated Interface : tun1 Assigned IPv4 Address : 192.168.255.205 Tunnel Protocol : PPTP Tunnel From : 151.71.144.16:31342 Start Time : 2013/02/04 11:35:24 Elapsed Time : 131 sec (2 minutes) Input Bytes : 11256 (11.0 KB) Input Packets : 130 Input Errors : 0 (0.0%) Output Bytes : 19241 (18.8 KB) Output Packets : 160 Output Errors : 17 (9.6%)
  • 16. npppd monitoring If you use pppx(4) interfaces you can have some info from the ifconfig command too # ifconfig pppx0 pppx0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1360 description: giovanni priority: 0 groups: pppx inet 192.168.255.1 --> 192.168.255.205 netmask 0xffffffff
  • 17. npppd monitoring As usual, with ipsec, ipsecctl is your friend # ipsecctl -s all FLOWS: flow esp in proto udp from 9.2.71.195 port l2tp to 192.168.2.250 port l2tp peer 9.2.71.195 srcid 192.168.2.250/32 dstid 192.168.1.101/32 type use flow esp out proto udp from 192.168.2.250 port l2tp to 9.2.71.195 port l2tp peer 9.2.71.195 srcid 192.168.2.250/32 dstid 192.168.1.101/32 type require SAD: esp transport from 192.168.2.250 to 9.2.71.195 spi 0x41f46e6a auth hmac-sha1 enc aes esp transport from 9.2.71.195 to 192.168.2.250 spi 0x6d7d8716 auth hmac-sha1 enc aes
  • 21. Microsoft tips and Microsoft bugs Microsoft, dns, kerberos and mtu
  • 22. Microsoft tips and bugs ipsec nat-t support Windows Registry Editor Version 5.00 [HKLMSYSTEMCurrentControlSetServicesPolicyAgent] "AssumeUDPEncapsulationContextOnSendRule"=dword:00000002
  • 23. npppd future fixing bugs better integration with pf arp cache support
  • 24. Thank you for your attention! Questions?