VPN Lab Zutao Zhu 03/26/2010. Outline VPN VPN Setup in VMWare VPN tasks OpenSSL How to Write Socket Programs using OpenSSL APIs.

Slides:



Advertisements
Similar presentations
Module 5: TLS and SSL 1. Overview Transport Layer Security Overview Secure Socket Layer Overview SSL Termination SSL in the Hosted Environment Load Balanced.
Advertisements

Precept 3 Host Configuration 1 Peng Sun. What TCP conn. running? Commands netstat [-n] [-p] [-c] (Linux) lsof -i -P (Mac) ss (newer version of netstat)
Securing Remote PC Access to UNIX/Linux Hosts with VPN or SSH Charles T. Moetului WRQ, Inc. (206)
11 TROUBLESHOOTING Chapter 12. Chapter 12: TROUBLESHOOTING2 OVERVIEW  Determine whether a network communications problem is related to TCP/IP.  Understand.
Module 10: Troubleshooting Network Access. Overview Troubleshooting Network Access Resources Troubleshooting LAN Authentication Troubleshooting Remote.
1 Linux Networking and Security Chapter 2. 2 Configuring Basic Networking Describe how networking devices differ from other Linux devices Configure Linux.
Module 5: Configuring Access for Remote Clients and Networks.
1 Objectives Configure Network Access Services in Windows Server 2008 RADIUS 1.
1 Configuring Virtual Private Networks for Remote Clients and Networks.
Access Control for Networks Problems: –Enforce an access control policy Allow trust relationships among machines –Protect local internet from outsiders.
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.
VPN Lab 2 Zutao Zhu 04/02/2010. Outline How a packet traverse in VPN How to write socket program Certificate.
Page: 1 Director 1.0 TECHNION Department of Computer Science The Computer Communication Lab (236340) Summer 2002 Submitted by: David Schwartz Idan Zak.
Scaling Service Requests Linux: ipvsadm & iptoip.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Microsoft Server 2008 R2 Group Policies & Network Policy and Access Services.
Firewall and Proxy Server Director: Dr. Mort Anvari Name: Anan Chen Date: Summer 2000.
Network Address Translation, Remote Access and Virtual Private Networks BSAD 146 Dave Novak Sources: Network+ Guide to Networks, Dean 2013.
TCP/IP Tools Lesson 5. Objectives Skills/ConceptsObjective Domain Description Objective Domain Number Using basic TCP/IP commands Understanding TCP/IP3.6.
Printer Installation Ben Wu A&S IT 09/18/2007. Outline  Preparation  Local Printer Installation  Network Printer Installation  Printer Sharing  Other.
Lecture slides prepared for “Business Data Communications”, 7/e, by William Stallings and Tom Case, Chapter 8 “TCP/IP”.
Hands-On Microsoft Windows Server 2008 Chapter 8 Managing Windows Server 2008 Network Services.
DrayTek VPN Solution. Outline What is VPN What does VPN Do Supported VPN Protocol How Many Tunnels does Vigor Support VPN Application Special VPN Application.
1 Microsoft Windows NT 4.0 Authentication Protocols Password Authentication Protocol (PAP) Challenge Handshake Authentication Protocol (CHAP) Microsoft.
4-1 PSe_4Konf.503 EAGLE Getting Started and Configuration.
Chapter 6 Configuring, Monitoring & Troubleshooting IPsec
Course 6421A Module 7: Installing, Configuring, and Troubleshooting the Network Policy Server Role Service Presentation: 60 minutes Lab: 60 minutes Module.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 7 Connect the SUSE Linux Enterprise Server to the Network.
Course 201 – Administration, Content Inspection and SSL VPN
TCP/IP Web Design & Layout January 23, TCP/IP For Dummies  The guts and the rules of the Internet and World Wide Web. A set of protocols, services,
1 Lab 3 Transport Layer T.A. Youngjoo Han. 2 Transport Layer  Providing logical communication b/w application processes running on different hosts 
11 NETWORK PROTOCOLS AND SERVICES Chapter 10. Chapter 10: Network Protocols and Services2 NETWORK PROTOCOLS AND SERVICES  Identify how computers on TCP/IP.
Configuring Routing and Remote Access(RRAS) and Wireless Networking
CHAPTER 2 PCs on the Internet Suraya Alias. The TCP/IP Suite of Protocols Internet applications – client/server applications The client requested data.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
Virtual Private Networking with OpenVPN Wim Kerkhoff Fraser Valley Linux Users Group April 15, 2004.
A+ Guide to Software: Managing, Maintaining, and Troubleshooting, 5e
Lab How to Use WANem Last Update Copyright 2011 Kenneth M. Chipps Ph.D. 1.
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.
Chapter 13 – Network Security
Remote Access Chapter 4. Learning Objectives Understand implications of IEEE 802.1x and how it is used Understand VPN technology and its uses for securing.
Objectives Configure routing in Windows Server 2008 Configure Routing and Remote Access Services in Windows Server 2008 Network Address Translation 1.
Internet Addresses. Universal Identifiers Universal Communication Service - Communication system which allows any host to communicate with any other host.
1 Week 6 – NPS and RADIUS Install and Configure a Network Policy Server Configure RADIUS Clients and Servers NPS Authentication Methods Monitor and Troubleshoot.
Wireless Networks and the NetSentron By: Darren Critchley.
Links and LANs Link between two computers via cross cable The most simple way to connect two hosts is to link the two hosts with a cross cable.
What’s New in Fireware v11.9.5
Day 14 Introduction to Networking. Unix Networking Unix is very frequently used as a server. –Server is a machine which “serves” some function Web Server.
Chapter 6-2 the TCP/IP Layers. The four layers of the TCP/IP model are listed in Table 6-2. The layers are The four layers of the TCP/IP model are listed.
1 實驗九:建置網路安全閘道器 教師: 助教:. 2 Outline  Background  Proxy – Squid  Firewall – IPTables  VPN – OpenVPN  Experiment  Internet gateway  Firewall  VPN.
Application Block Diagram III. SOFTWARE PLATFORM Figure above shows a network protocol stack for a computer that connects to an Ethernet network and.
OpenVPN Vs IPSec measure performance
Integrating and Troubleshooting Citrix Access Gateway.
Network Infrastructure Microsoft Windows 2003 Network Infrastructure MCSE Study Guide for Exam
Networking Material taken mainly from HowStuffWorks.com.
Mininet and Openflow Labs. Install Mininet (do not do this in class) Download VirtualBox Download Xming for windows (X11) Download Mininet VM for linux-ubuntu.
ERICSON BRANDON M. BASCUG Alternate - REGIONAL NETWORK ADMINISTRATOR HOW TO TROUBLESHOOT TCP/IP CONNECTIVITY.
Securing Access to Data Using IPsec Josh Jones Cosc352.
IP Security (IPSec) Matt Hermanson. What is IPSec? It is an extension to the Internet Protocol (IP) suite that creates an encrypted and secure conversation.
6. The Open Network Lab Overview and getting started
Microsoft Windows NT 4.0 Authentication Protocols
Virtual Private Networking with OpenVPN
Chapter 6: Network Layer
IP Network Layer and Ethernet Encapsulation
IS 4506 Server Configuration (HTTP Server)
Chapter 10: Advanced Cisco Adaptive Security Appliance
WireGuard zswu.
Virtual Private Network
IS 4506 Configuring the FTP Service
Presentation transcript:

VPN Lab Zutao Zhu 03/26/2010

Outline VPN VPN Setup in VMWare VPN tasks OpenSSL How to Write Socket Programs using OpenSSL APIs

VPN Virtual Private Network –Create a private scope of computer communication –Provide a secure extension of a private network into an unsecure network, Internet –Built on IPSec or Secure Socket Layer (SSL)

VPN Three types –Host-to-Host Tunnel –Host-to-Gateway Tunnel –Gateway-to-Gateway Tunnel

Tun/tap Interface virtual network kernel drivers software-only interfaces, that is, they exist only in the kernel no physical hardware component Have a special file descriptors a tap interface outputs (and must be given) full ethernet frames a tun interface outputs (and must be given) "raw" IP packets

Tun/tap Interface (cont.) When a program is attached to a TUN/TAP interface, the IP packets that the computer sends to this interface will be piped into the program; the IP packets that the program sends to the interface will be piped into the computer, as if they came from the outside through this virtual network interface

Tun/tap Interface (cont.) IP addresses can be assigned traffic can be analyzed routes pointing to it can be established

Tun/tap Setup Call tun_alloc() to create the tun/tap interface in program Configure the tun/tap interface (ifconfig) Enable the tun/tap interface (ifconfig) Set the routing rules (route add) Use the tunnel (any tool, like ping, ssh, etc.)

Your First Task Build a UDP tunnel Explain why TCP over TCp is not good

Host-to-Host Tunnel Use UDP

Host-to-Gateway Tunnel Use two physical machines, one acting as a host, the other acting as the gateway, which has many other virtual machines Use Port Forwarding to make certain port of the VM accessible to the outside VMWare Setup Gateway Setup Host Setup

VMWare Port Forwarding on the host machine of Gateway

Gateway Setup On one physical machine, we use one virtual machine as the gateway, the others as the internal hosts Gateway Setup –Add another interface –Enable IP forwarding feature –Configure the routing table for gateway

Add Another Interface for Gateway

IP forwarding $ sudo sysctl net.ipv4.ip_forward=1

Add Routing Rules man route – read the route manual page Use route add, example $ sudo route add -net netmask gw

Host Setup You have to configure the routing table by yourself Similar with the previous slide

Your second task Make sure Host-to-Gateway tunnel works On host in one physical machine, you can ping/telnet/ssh/ftp any IP behind the Gateway on the other physical machine

Gateway-to-Gateway Tunnel

Your third task Make sure Gateway-to-Gateway tunnel works On one host behind the Gateway in one physical machine, you can ping/telnet/ssh/ftp any IP behind the Gateway on the other physical machine

OpenSSL Prepare work –apt-get source openssl –./config –make –make install Directory of headers and libraries –/usr/local/ssl/include –/usr/local/ssl/lib

What OpenSSL does Encrypt/decrypt Hash Create certificates APIs

Demo Client/server program with OpenSSL

Header Files /* OpenSSL headers */ #include "openssl/bio.h" #include "openssl/ssl.h" #include "openssl/err.h" /* Initializing OpenSSL */ SSL_load_error_strings(); ERR_load_BIO_strings(); OpenSSL_add_all_algorithms();

Creating and opening a connection BIO * bio; bio = BIO_new_connect("hostname:port"); if(bio == NULL) { /* Handle the failure */ } if(BIO_do_connect(bio) <= 0) { /* Handle failed connection */ }

Reading from the connection int x = BIO_read(bio, buf, len); if(x == 0) { /* Handle closed connection */ } else if(x < 0) { if(! BIO_should_retry(bio)) { /* Handle failed read here */ } /* Do something to handle the retry */ }

Writing to the connection if(BIO_write(bio, buf, len) <= 0) { if(! BIO_should_retry(bio)) { /* Handle failed write here */ } /* Do something to handle the retry */ }

Closing the connection /* To reuse the connection, use this line */ BIO_reset(bio); /* To free it from memory, use this line */ BIO_free_all(bio);

Setting up a secure connection Secure connections require a handshake after the connection is established. the server sends a certificate to the client the client then verifies against a set of trust certificates It also checks the certificate to make sure that it has not expired a trust certificate store be loaded prior to establishing the connection The client will send a certificate to the server only if the server requests one

Setting up the SSL pointers if(! SSL_CTX_load_verify_locations(ctx, "/path/to/TrustStore.pem", NULL)) { /* Handle failed load here */ }

Preparing a certificate folder and using it /* Use this at the command line */ c_rehash /path/to/certfolder /* Then call this from within the application */ if(! SSL_CTX_load_verify_locations(ctx, NULL, "/path/to/certfolder")) { /* Handle error here */ }

Setting up the BIO object bio = BIO_new_ssl_connect(ctx); BIO_get_ssl(bio, & ssl); SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);

Opening a secure connection /* Attempt to connect */ BIO_set_conn_hostname(bio, "hostname:port"); /* Verify the connection opened and perform the handshake */ if(BIO_do_connect(bio) <= 0) { /* Handle failed connection */ }

Checking if a certificate is valid if(SSL_get_verify_result(ssl) != X509_V_OK) { /* Handle the failed verification */ }

Cleaning up the SSL context SSL_CTX_free(ctx);

References ation/networking/tuntap.txthttp:// ation/networking/tuntap.txt tcp.htmlhttp://sites.inka.de/~W1011/devel/tcp- tcp.html tuntap.phphttp://waldner.netsons.org/d3-ssh- tuntap.php

Reference ibrary/l-openssl.htmlhttp:// ibrary/l-openssl.html