WireGuard zswu.

Slides:



Advertisements
Similar presentations
Encrypting Wireless Data with VPN Techniques
Advertisements

1 Network Address Translation (NAT) Relates to Lab 7. Module about private networks and NAT.
Prof. Kristofer S.J. Pister’s team Berkeley Sensor and Actuator Center University of California, Berkeley.
IUT– Network Security Course 1 Network Security Firewalls.
VPN Lab Zutao Zhu 03/26/2010. Outline VPN VPN Setup in VMWare VPN tasks OpenSSL How to Write Socket Programs using OpenSSL APIs.
Ipchains and Iptables Linux operating system natively supports packet-filtering rules: Kernel versions 2.2 and earlier support the ipchains command. Kernel.
Module 5: Configuring Access for Remote Clients and Networks.
K. Salah 1 Chapter 31 Security in the Internet. K. Salah 2 Figure 31.5 Position of TLS Transport Layer Security (TLS) was designed to provide security.
1 Network Address Translation (NAT) Relates to Lab 7. Module about private networks and NAT.
Course 201 – Administration, Content Inspection and SSL VPN
Day15 IP Space/Setup. IP Suite of protocols –TCP –UDP –ICMP –GRE… Gives us many benefits –Routing of packets over internet –Fragmentation/Reassembly of.
PSeries Technical Conference L19 Brian Dolan-Goecke Atlanta, GeorgiaOctober 8-12, 2001 Linux VPN.
NetFilter – IPtables Firewall –Series of rules to govern what Kind of access to allow on your system –Packet filtering –Drop or Accept packets NAT –Network.
07/11/ L10/1/63 COM342 Networks and Data Communications Ian McCrumRoom 5B18 Tel: voice.
Virtual Private Networking with OpenVPN Wim Kerkhoff Fraser Valley Linux Users Group April 15, 2004.
© 2007 Cisco Systems, Inc. All rights reserved.ISCW-Mod9_L8 1 Network Security 2 Module 6 – Configure Remote Access VPN.
Implementing ISA Server Publishing. Introduction What Are Web Publishing Rules? ISA Server uses Web publishing rules to make Web sites on protected networks.
Page 1 NAT & VPN Lecture 8 Hassan Shuja 05/02/2006.
SCSC 455 Computer Security Network Security. Control access to system Access control mechanisms in specific network programs  e.g. 1, wu-FTP server support.
Objectives Configure routing in Windows Server 2008 Configure Routing and Remote Access Services in Windows Server 2008 Network Address Translation 1.
VIRTUAL PRIVATE NETWORK By: Tammy Be Khoa Kieu Stephen Tran Michael Tse.
Module 5: Configuring Access for Remote Clients and Networks.
1 實驗九:建置網路安全閘道器 教師: 助教:. 2 Outline  Background  Proxy – Squid  Firewall – IPTables  VPN – OpenVPN  Experiment  Internet gateway  Firewall  VPN.
OpenVPN Vs IPSec measure performance
1 Firewalls Types of Firewalls Inspection Methods  Static Packet Inspection  Stateful Packet Inspection  NAT  Application Firewalls Firewall Architecture.
Unit - III. Providing a Caching Proxy Server (1) A caching proxy server is software that stores (caches) frequently requested internet objects such as.
Virtual Private Network. ATHENA Main Function of VPN  Privacy  Authenticating  Data Integrity  Antireplay.
Wireless Access Point. What is a WAP?  A Wireless access point (WAP) is a device that allows a wireless device to connect to a wired network.
HIP-Based NAT Traversal in P2P-Environments
Secure Communications ● Cleartext vs. encryption and encapsulation ● Protocols not to use ● SSH – scp/ftp – SSH tunnelling ● VPN.
Routing with Linux 'cause you really love the command line
Home Networking CCCC Linux Desktop SIG August 20, 2007.
Advanced Network Labs & Remote Network Agent
An Analysis on NAT Security
Managing and Directing Network Traffic with Linux
Virtual Private Network Access for Remote Networks
Building Distributed Networks using VPNs David R Newman.
NAT (Network Address Translation)
Installing TMG & Choosing a Client Type
Virtual Private Network
NET 536 Network Security Firewalls and VPN
Virtual Private Networking with OpenVPN
Network Address Translation (NAT)
ECE 544: Middlebox lab Abhigyan Sharma.
Network Address Translation (NAT)
Stable 2.7 release the VPN Solution for Linux!
Building Distributed Networks using VPNs David R Newman.
XWN740 X-Windows Configuring and Using Remote Access
IPSec VPN Chapter 13 of Malik.
SoftEther VPN 報告者:蘇己盛 日期:2014/07/01.
VPN-Implementation Using UBUNTU OS and OpenVPN and Hamachi in client-server environment. By Ruphin Byamungu, Kusinza United States International University-Nairobi.
Packet Sniffing.
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Access Control Lists CCNA 2 v3 – Module 11
Setting Up Firewall using Netfilter and Iptables
Firewalls Routers, Switches, Hubs VPNs
IP-Spoofing and Source Routing Connections
Chapter 8 Network Perimeter Security
From ACCEPT to MASQUERADE Tim(othy) Clark (eclipse)
APACHE WEB SERVER.
Networking and Network Protocols (Part2)
Mobile IP Outline Homework #4 Solutions Intro to mobile IP Operation
IP Forwarding Relates to Lab 3.
Mobile IP Outline Intro to mobile IP Operation Problems with mobility.
Site-to-site (S2S) VPN Gateway between Azure and On-Premises
Virtual Private Network zswu
OpenVPN zswu.
Virtual Private Network
Computer System Administration Homework 1 Install FreeBSD & WireGuard
Presentation transcript:

WireGuard zswu

WireGuard Introduction Simple and fast VPN solution Low overhead Deep integration with Linux kernel Over UDP Peer to Peer Secure Built-in Roaming Connections keep alive even if the underlay network change

TUN/TAP TAP TUN Layer 2 More overhead(L2) Transfer any protocol Support L2+ services TUN Layer 3 Less Overhead(L3) Only IPv4 , IPv6 Support L3+ services

Installation https://www.wireguard.com/install/ Linux kernel >= 3.10 CentOS $ sudo curl -Lo /etc/yum.repos.d/wireguard.repo https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo $ sudo yum install epel-release $ sudo yum install wireguard-dkms wireguard-tools FreeBSD # pkg install wireguard

Tools Provided by WireGuard System tools wg Set and retrieve configuration of WireGuard interface wg-quick Set up a WireGuard interface simply System tools ip / ifconfig Setup wg interfaces Systemd Auto start after boot

Setup by hand (Linux) Add interface # ip link add dev wg0 type wireguard Setup ip # ip address add dev wg0 192.168.2.1/24 # ip address add dev wg0 192.168.2.1 peer 192.168.2.2 Setup wg configurations # wg setconf wg0 myconfig.conf # wg set wg0 listen-port 51820 private-key /path/to/private-key peer ABCDEF... allowed-ips 192.168.88.0/24 endpoint 209.202.254.14:8172 Start interface # ip link set up dev wg0

Setup by configuration Configuration file /etc/wireguard/wg0.conf Start interface # systemctl enable wg-quick@wg0 # wg-quick up wg0

Example Configurations – Client [Interface] Address = 10.113.0.4/16 PrivateKey = [CLIENT PRIVATE KEY] [Peer] PublicKey = [SERVER PUBLICKEY] AllowedIPs = 10.113.0.0/16, 10.123.45.0/24, 1234:4567:89ab::/48 Endpoint = [SERVER ENDPOINT]:51820 PersistentKeepalive = 25

Example Configurations – Server [Interface] Address = 10.113.0.254/16 ListenPort = 51820 PrivateKey = [SERVER PRIVATE KEY] # note - substitute eth0 in the following lines to match the Internet-facing interface PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE [Peer] # client foo PublicKey = [FOO's PUBLIC KEY] PresharedKey = [PRE-SHARED KEY] AllowedIPs = 10.113.0.1/32, 10.113.1.0/24 # client bar PublicKey = [BAR's PUBLIC KEY] AllowedIPs = 10.113.0.2/32, 10.113.2.0/24

Configuration – Interface Address (optional) IP address and netmask of the interface ListenPort Wg service listen port PrivateKey Private key of the interface PreUp / PreDown / PostUp / PostDown Run shell scripts before / after interface up / down E.g., Setup firewall rules

Configuration – Peer PublicKey AllowedIPs Endpoint (Optional) Public key of the peer AllowedIPs IP addresses that are allowed to pass through this peer Endpoint (Optional) Location of the peer Wg will also use the previous connections to detect this configuration PersistentKeepalive (Optional) By default, Wg send packs only if there are data to be send Send packs to peer periodically to bypass NAT or Firewall PresharedKey (Optional) Pre-shared key for additional symmetric encryption

Generate Key Pair Key pair Pre-shared key $ wg genkey > privatekey $ wg pubkey < privatekey > publickey Pre-shared key # wg genpsk > preshared

Cryptokey Routing WireGuard will add routing rules to system routing table according to the configurations Once packets go inside WireGuard, it is routed according to Cryptokey Routing When sending packets, the list of allowed IPs behaves as a sort of routing table When receiving packets, the list of allowed IPs behaves as a sort of access control list

Built-in Roaming When the client connects to server, server record the IP of client, and communicate with client by this IP When client (or even server) change its IP, it sends data to the peer and the peer will update the IP Both client and server send encrypted data to the most recent IP endpoint for which they authentically decrypted data. Thus, there is full IP roaming on both ends

Example – Build a Bridge VPN Server Follow the setup guide and build a Wg peer as a VPN server Enable ip forwarding # sysctl net.ipv4.ip_forward=1 Setup NAT so clients can connect to internet through the VPN server Add these lines to wg0.conf PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

Connect from mobile For mobile app, user can use QR-Code to import configuration file, instead of copy-paste private key from other ways $ qrencode -t ansiutf8 < wgconfig.conf

User authentication Every peer has its own private key for identity authentication Integration with other authentication system (like LDAP) may need other software support For now, WireGuard only provide simple tunnel connections between peers

Reference https://www.wireguard.com/ https://www.wireguard.com/quickstart/ https://wiki.archlinux.org/index.php/WireGuard