SlideShare a Scribd company logo
1 of 16
Wireguard
A Virtual Private Network Tunnel
Eric Roberts
Hoffman Lab
Why Bother?
● A personal VPN Tunnel
○ The alternatives to Wireguard are very unfriendly
○ Runs everywhere including your phone
● Access to your own network and not a single machine
○ Network attached storage
○ More than one computer behind a firewall
● Single encrypted point of network access to a container
● Need to access to internet resources available from your own network
Maybe not for me?
● Only need access to a single machine
○ Probably should just use ssh, remote desktop, etc.
● No personal network
Virtual Private Network
● A private network that can be connected to from
another device through a public network (e.g. the
internet)
● When you connect to the VPN, you are effectively
part of the private network
Wireguard
● Likely the simplest VPN tunnel to setup
compared to all existing competitors
● Open source
● Cryptographically secure
● Works on all major OSes
○ Linux adopted kernel support in 2020
How it works
● Create a virtual network interface
● Create a private and public cryptographic key
○ Give your public key away to all networks you
want to connect to using wireguard
● Place public keys of networks you wish to connect
to in your own configuration
wg0 - The virtual interface
● Manage the device like any other network device
on the system
○ Use existing tools to assign it an IP address
and for routing management (if necessary)
■ e.g. ip-address(8), ifconfig(8), etc.
○ OS specific
Subnet selection
● RFC 1918
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
The subnet you connect from should *not* match the
one you are connecting to in order to avoid IP
routing conflicts.
IP4/6 Forwarding
● This is by default enabled on router software
○ No need to touch if running Wireguard on a
router
● Otherwise look up specific to your OS where your
running your host interface
Wireguard specifics
● Permitted peers are managed by a given pair:
○ Public key
○ Virtual interface IP address (wg0)
[Peer]
PublicKey = gN65BkIKy1eCE9pP1wdc8ROUtkHLF2PfAqYdyYBz6EA=
AllowedIPs = 10.10.10.230/32
Endpoints
● The endpoint is the IP address and port of the
machine you wish to connect to
● Allowed IPs refers to the address assigned to the
wireguard virtual interface (wg0)
[Peer]
PublicKey = HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=
Endpoint = 24.42.42.42:51820
PersistentKeepalive = 25
AllowedIPs = 0.0.0.0/0
Wireguard key generation
$ wg genkey > privatekey # Create private key in file `privatekey`
$ wg pubkey < privatekey > publickey # Create public key
$ wg set wg0 private-key privatekey # Sets wg0 device’s private key
Adding peers in Wireguard
$ wg set wg0 peer longhexpublickeygoesrighthere allowed-ips
192.168.8.2/32 # Allow peer with key longhexpublickeygoesrighthere to
connect with IP 192.168.8.2
Summary
● If you need a VPN - use Wireguard
● Create a wireguard network interface
○ Forward IP4/IP6 traffic if necessary
○ Assign it an IP
● Create key pair, give your public key to the
network you wish to connect to and assign the
private key to your own interface
● Add public keys of the networks you want to
connect to
Questions?

More Related Content

Similar to Wireguard: A Virtual Private Network Tunnel

Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29MysoreMuleSoftMeetup
 
Basics of networking and demo on vpc
Basics of networking and demo on vpcBasics of networking and demo on vpc
Basics of networking and demo on vpcJai Prakash Dave
 
Building Trojan Hardware at Home
Building Trojan Hardware at HomeBuilding Trojan Hardware at Home
Building Trojan Hardware at HomeE Hacking
 
platform without vendor lock-in
platform without vendor lock-inplatform without vendor lock-in
platform without vendor lock-inKai Jokiniemi
 
Building a Cyber Range - Kevin Cardwell
Building a Cyber Range - Kevin CardwellBuilding a Cyber Range - Kevin Cardwell
Building a Cyber Range - Kevin CardwellEC-Council
 
Videoconference
VideoconferenceVideoconference
Videoconferenceeonx_32
 
Marrying a Penguin: Logging in and mounting encrypted partitions using a ring...
Marrying a Penguin: Logging in and mounting encrypted partitions using a ring...Marrying a Penguin: Logging in and mounting encrypted partitions using a ring...
Marrying a Penguin: Logging in and mounting encrypted partitions using a ring...benwhorwood
 
Internet Protocol Deep-Dive
Internet Protocol Deep-DiveInternet Protocol Deep-Dive
Internet Protocol Deep-DiveGLC Networks
 
Wireless security beyond password cracking by Mohit Ranjan
Wireless security beyond password cracking by Mohit RanjanWireless security beyond password cracking by Mohit Ranjan
Wireless security beyond password cracking by Mohit RanjanOWASP Delhi
 
Controlling an Arduino with Android
Controlling an Arduino with AndroidControlling an Arduino with Android
Controlling an Arduino with AndroidA. Hernandez
 
DEF CON 23 - Phil Polstra - hacker in the wires
DEF CON 23 - Phil Polstra - hacker in the wiresDEF CON 23 - Phil Polstra - hacker in the wires
DEF CON 23 - Phil Polstra - hacker in the wiresFelipe Prado
 
Platform without vendor lock-in
Platform without vendor lock-inPlatform without vendor lock-in
Platform without vendor lock-inSakari Hoisko
 
network Fundaa.pptx
network Fundaa.pptxnetwork Fundaa.pptx
network Fundaa.pptxssusercb53d4
 
Configure router for wap (wireless access point
Configure router for wap (wireless access pointConfigure router for wap (wireless access point
Configure router for wap (wireless access pointsergio goco
 
Deploying Specter Desktop - Mechanism, not Policy
Deploying Specter Desktop - Mechanism, not PolicyDeploying Specter Desktop - Mechanism, not Policy
Deploying Specter Desktop - Mechanism, not Policyk9ert
 
BOX of Illusion MOSEC'17
BOX of Illusion MOSEC'17BOX of Illusion MOSEC'17
BOX of Illusion MOSEC'17Python0x0
 

Similar to Wireguard: A Virtual Private Network Tunnel (20)

Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
 
Basics of networking and demo on vpc
Basics of networking and demo on vpcBasics of networking and demo on vpc
Basics of networking and demo on vpc
 
Wireguard VPN
Wireguard VPNWireguard VPN
Wireguard VPN
 
Building Trojan Hardware at Home
Building Trojan Hardware at HomeBuilding Trojan Hardware at Home
Building Trojan Hardware at Home
 
platform without vendor lock-in
platform without vendor lock-inplatform without vendor lock-in
platform without vendor lock-in
 
Building a Cyber Range - Kevin Cardwell
Building a Cyber Range - Kevin CardwellBuilding a Cyber Range - Kevin Cardwell
Building a Cyber Range - Kevin Cardwell
 
Videoconference
VideoconferenceVideoconference
Videoconference
 
Marrying a Penguin: Logging in and mounting encrypted partitions using a ring...
Marrying a Penguin: Logging in and mounting encrypted partitions using a ring...Marrying a Penguin: Logging in and mounting encrypted partitions using a ring...
Marrying a Penguin: Logging in and mounting encrypted partitions using a ring...
 
class12_Networking2
class12_Networking2class12_Networking2
class12_Networking2
 
Internet Protocol Deep-Dive
Internet Protocol Deep-DiveInternet Protocol Deep-Dive
Internet Protocol Deep-Dive
 
Wireless security beyond password cracking by Mohit Ranjan
Wireless security beyond password cracking by Mohit RanjanWireless security beyond password cracking by Mohit Ranjan
Wireless security beyond password cracking by Mohit Ranjan
 
Controlling an Arduino with Android
Controlling an Arduino with AndroidControlling an Arduino with Android
Controlling an Arduino with Android
 
DEF CON 23 - Phil Polstra - hacker in the wires
DEF CON 23 - Phil Polstra - hacker in the wiresDEF CON 23 - Phil Polstra - hacker in the wires
DEF CON 23 - Phil Polstra - hacker in the wires
 
Platform without vendor lock-in
Platform without vendor lock-inPlatform without vendor lock-in
Platform without vendor lock-in
 
network Fundaa.pptx
network Fundaa.pptxnetwork Fundaa.pptx
network Fundaa.pptx
 
Configure router for wap (wireless access point
Configure router for wap (wireless access pointConfigure router for wap (wireless access point
Configure router for wap (wireless access point
 
Deploying Specter Desktop - Mechanism, not Policy
Deploying Specter Desktop - Mechanism, not PolicyDeploying Specter Desktop - Mechanism, not Policy
Deploying Specter Desktop - Mechanism, not Policy
 
BOX of Illusion MOSEC'17
BOX of Illusion MOSEC'17BOX of Illusion MOSEC'17
BOX of Illusion MOSEC'17
 
Week13
Week13Week13
Week13
 
Week13
Week13Week13
Week13
 

More from Hoffman Lab

GNU Parallel: Lab meeting—technical talk
GNU Parallel: Lab meeting—technical talkGNU Parallel: Lab meeting—technical talk
GNU Parallel: Lab meeting—technical talkHoffman Lab
 
Efficient querying of genomic reference databases with gget
Efficient querying of genomic reference databases with ggetEfficient querying of genomic reference databases with gget
Efficient querying of genomic reference databases with ggetHoffman Lab
 
WashU Epigenome Browser
WashU Epigenome BrowserWashU Epigenome Browser
WashU Epigenome BrowserHoffman Lab
 
Plotting heatmap with matplotlib/seaborn
Plotting heatmap with matplotlib/seabornPlotting heatmap with matplotlib/seaborn
Plotting heatmap with matplotlib/seabornHoffman Lab
 
Go Get Data (GGD)
Go Get Data (GGD)Go Get Data (GGD)
Go Get Data (GGD)Hoffman Lab
 
fastp: the FASTQ pre-processor
fastp: the FASTQ pre-processorfastp: the FASTQ pre-processor
fastp: the FASTQ pre-processorHoffman Lab
 
R markdown and Rmdformats
R markdown and RmdformatsR markdown and Rmdformats
R markdown and RmdformatsHoffman Lab
 
File searching tools
File searching toolsFile searching tools
File searching toolsHoffman Lab
 
Better BibTeX (BBT) for Zotero
Better BibTeX (BBT) for ZoteroBetter BibTeX (BBT) for Zotero
Better BibTeX (BBT) for ZoteroHoffman Lab
 
Awk primer and Bioawk
Awk primer and BioawkAwk primer and Bioawk
Awk primer and BioawkHoffman Lab
 
Terminals and Shells
Terminals and ShellsTerminals and Shells
Terminals and ShellsHoffman Lab
 
BioRender & Glossary/Acronym
BioRender & Glossary/AcronymBioRender & Glossary/Acronym
BioRender & Glossary/AcronymHoffman Lab
 
BioSyntax: syntax highlighting for computational biology
BioSyntax: syntax highlighting for computational biologyBioSyntax: syntax highlighting for computational biology
BioSyntax: syntax highlighting for computational biologyHoffman Lab
 
Get Good With Git
Get Good With GitGet Good With Git
Get Good With GitHoffman Lab
 
Tech Talk: UCSC Genome Browser
Tech Talk: UCSC Genome BrowserTech Talk: UCSC Genome Browser
Tech Talk: UCSC Genome BrowserHoffman Lab
 
MultiQC: summarize analysis results for multiple tools and samples in a singl...
MultiQC: summarize analysis results for multiple tools and samples in a singl...MultiQC: summarize analysis results for multiple tools and samples in a singl...
MultiQC: summarize analysis results for multiple tools and samples in a singl...Hoffman Lab
 
dreamRs: interactive ggplot2
dreamRs: interactive ggplot2dreamRs: interactive ggplot2
dreamRs: interactive ggplot2Hoffman Lab
 
Basic Cryptography & Security
Basic Cryptography & SecurityBasic Cryptography & Security
Basic Cryptography & SecurityHoffman Lab
 

More from Hoffman Lab (20)

GNU Parallel: Lab meeting—technical talk
GNU Parallel: Lab meeting—technical talkGNU Parallel: Lab meeting—technical talk
GNU Parallel: Lab meeting—technical talk
 
TCRpower
TCRpowerTCRpower
TCRpower
 
Efficient querying of genomic reference databases with gget
Efficient querying of genomic reference databases with ggetEfficient querying of genomic reference databases with gget
Efficient querying of genomic reference databases with gget
 
WashU Epigenome Browser
WashU Epigenome BrowserWashU Epigenome Browser
WashU Epigenome Browser
 
Plotting heatmap with matplotlib/seaborn
Plotting heatmap with matplotlib/seabornPlotting heatmap with matplotlib/seaborn
Plotting heatmap with matplotlib/seaborn
 
Go Get Data (GGD)
Go Get Data (GGD)Go Get Data (GGD)
Go Get Data (GGD)
 
fastp: the FASTQ pre-processor
fastp: the FASTQ pre-processorfastp: the FASTQ pre-processor
fastp: the FASTQ pre-processor
 
R markdown and Rmdformats
R markdown and RmdformatsR markdown and Rmdformats
R markdown and Rmdformats
 
File searching tools
File searching toolsFile searching tools
File searching tools
 
Better BibTeX (BBT) for Zotero
Better BibTeX (BBT) for ZoteroBetter BibTeX (BBT) for Zotero
Better BibTeX (BBT) for Zotero
 
Awk primer and Bioawk
Awk primer and BioawkAwk primer and Bioawk
Awk primer and Bioawk
 
Terminals and Shells
Terminals and ShellsTerminals and Shells
Terminals and Shells
 
BioRender & Glossary/Acronym
BioRender & Glossary/AcronymBioRender & Glossary/Acronym
BioRender & Glossary/Acronym
 
Linters in R
Linters in RLinters in R
Linters in R
 
BioSyntax: syntax highlighting for computational biology
BioSyntax: syntax highlighting for computational biologyBioSyntax: syntax highlighting for computational biology
BioSyntax: syntax highlighting for computational biology
 
Get Good With Git
Get Good With GitGet Good With Git
Get Good With Git
 
Tech Talk: UCSC Genome Browser
Tech Talk: UCSC Genome BrowserTech Talk: UCSC Genome Browser
Tech Talk: UCSC Genome Browser
 
MultiQC: summarize analysis results for multiple tools and samples in a singl...
MultiQC: summarize analysis results for multiple tools and samples in a singl...MultiQC: summarize analysis results for multiple tools and samples in a singl...
MultiQC: summarize analysis results for multiple tools and samples in a singl...
 
dreamRs: interactive ggplot2
dreamRs: interactive ggplot2dreamRs: interactive ggplot2
dreamRs: interactive ggplot2
 
Basic Cryptography & Security
Basic Cryptography & SecurityBasic Cryptography & Security
Basic Cryptography & Security
 

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Wireguard: A Virtual Private Network Tunnel

  • 1. Wireguard A Virtual Private Network Tunnel Eric Roberts Hoffman Lab
  • 2. Why Bother? ● A personal VPN Tunnel ○ The alternatives to Wireguard are very unfriendly ○ Runs everywhere including your phone ● Access to your own network and not a single machine ○ Network attached storage ○ More than one computer behind a firewall ● Single encrypted point of network access to a container ● Need to access to internet resources available from your own network
  • 3. Maybe not for me? ● Only need access to a single machine ○ Probably should just use ssh, remote desktop, etc. ● No personal network
  • 4. Virtual Private Network ● A private network that can be connected to from another device through a public network (e.g. the internet) ● When you connect to the VPN, you are effectively part of the private network
  • 5. Wireguard ● Likely the simplest VPN tunnel to setup compared to all existing competitors ● Open source ● Cryptographically secure ● Works on all major OSes ○ Linux adopted kernel support in 2020
  • 6. How it works ● Create a virtual network interface ● Create a private and public cryptographic key ○ Give your public key away to all networks you want to connect to using wireguard ● Place public keys of networks you wish to connect to in your own configuration
  • 7. wg0 - The virtual interface ● Manage the device like any other network device on the system ○ Use existing tools to assign it an IP address and for routing management (if necessary) ■ e.g. ip-address(8), ifconfig(8), etc. ○ OS specific
  • 8.
  • 9. Subnet selection ● RFC 1918 10.0.0.0 - 10.255.255.255 (10/8 prefix) 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) The subnet you connect from should *not* match the one you are connecting to in order to avoid IP routing conflicts.
  • 10. IP4/6 Forwarding ● This is by default enabled on router software ○ No need to touch if running Wireguard on a router ● Otherwise look up specific to your OS where your running your host interface
  • 11. Wireguard specifics ● Permitted peers are managed by a given pair: ○ Public key ○ Virtual interface IP address (wg0) [Peer] PublicKey = gN65BkIKy1eCE9pP1wdc8ROUtkHLF2PfAqYdyYBz6EA= AllowedIPs = 10.10.10.230/32
  • 12. Endpoints ● The endpoint is the IP address and port of the machine you wish to connect to ● Allowed IPs refers to the address assigned to the wireguard virtual interface (wg0) [Peer] PublicKey = HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw= Endpoint = 24.42.42.42:51820 PersistentKeepalive = 25 AllowedIPs = 0.0.0.0/0
  • 13. Wireguard key generation $ wg genkey > privatekey # Create private key in file `privatekey` $ wg pubkey < privatekey > publickey # Create public key $ wg set wg0 private-key privatekey # Sets wg0 device’s private key
  • 14. Adding peers in Wireguard $ wg set wg0 peer longhexpublickeygoesrighthere allowed-ips 192.168.8.2/32 # Allow peer with key longhexpublickeygoesrighthere to connect with IP 192.168.8.2
  • 15. Summary ● If you need a VPN - use Wireguard ● Create a wireguard network interface ○ Forward IP4/IP6 traffic if necessary ○ Assign it an IP ● Create key pair, give your public key to the network you wish to connect to and assign the private key to your own interface ● Add public keys of the networks you want to connect to

Editor's Notes

  1. If you’re thinking about trying something like OpenVPN - don’t There’s userspace options Wireguard as well so even if there’s no native kernel support, I can still work on your operating system.
  2. All passing of public keys to other computers and peers on your network are out of scope for wireguard, you must arrange this somehow on your own. Not a big deal since they are public keys so there’s no security risk involved.
  3. The idea of virtual network interface is that it’s a network interface that is abstracted away from the underlying hardware. You can multiple virtual interfaces referring to the same underlying hardware and the operating system takes care of it. The most important part about setting up a virtual interface with wireguard is giving it an IP address And since you have the interface you have full control of how and what it can access.
  4. The endpoint only needs to be initially reachable. If either peer changes IP, by say roaming for example, wireguard will remember the last used endpoint to reach and update accordingly. The PersistentKeepalive option is necessary if you’re connecting to a peer behind NAT/firewall to keep to address translation valid. It’s worth noting that on both the server and the client you can multiple peers. This has the nice implication that when sending packets from this interface, the allowed IPs acts as a sort of routing table to choose which peer to direct traffic to. And when receiving packets from a peer, the allowed IPs acts as a sort of access control list.