Installing and running FreeS/WAN. What is FreeS/WAN An implementation of IpSec for Linux –Can be found at www.freeswan.org Helps setup encrypted and/or.

Slides:



Advertisements
Similar presentations
Jump to first page Setup Ethernet & PPP client on Laptop computer Presented by: Xuewu Cai Jianfang Wang.
Advertisements

Static Routing Exercise. What will the exercise involve?  Unix network interface configuration  Cisco network interface configuration  Static routes.
Recitation 6 Midterm 1’s solution Project 2 IP Forwarding CIDR.
Ipchains and Iptables Linux operating system natively supports packet-filtering rules: Kernel versions 2.2 and earlier support the ipchains command. Kernel.
Linux network troubleshooting If your network connection is not working..
11 TROUBLESHOOTING Chapter 12. Chapter 12: TROUBLESHOOTING2 OVERVIEW  Determine whether a network communications problem is related to TCP/IP.  Understand.
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.
588 Section 2 Neil Spring April 13, Schedule traceroute (context) Paxson’s Pathologies Dijkstra’s (shortest path) Algorithm Subnetting Homework.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Network Management And Debugging
Network Debugging Organizational Communications and Technologies Prithvi Rao H. John Heinz III School of Public Policy and Management Carnegie Mellon University.
Chapter 5 Network Layer CIS 81 Networking Fundamentals Rick Graziani Cabrillo College Last Updated: 3/9/2008.
TCP/IP Protocol Suite 1 Chapter 6 Upon completion you will be able to: Delivery, Forwarding, and Routing of IP Packets Understand the different types of.
Linux Setting up your network. Basic Approaches Configure during installation –Disadvantage -> not able to redo easily –Advantage-> holds your hand Configure.
Linux Networking Sirak Kaewjamnong. 2 Configuration NIC IP address  NIC: Network Interface Card  Use “ipconfig” command to determine IP address, interface.
TCP/IP Protocol Suite 1 Chapter 6 Upon completion you will be able to: Delivery, Forwarding, and Routing of IP Packets Understand the different types of.
Virtual Private Network (VPN) © N. Ganesan, Ph.D..
CCENT Review. Put the following descriptions in order from Layer 7 to Layer 1 and give the name of each layer.
1 Semester 2 Module 6 Routing and Routing Protocols YuDa college of business James Chen
Linux Networking Commands
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 7 Connect the SUSE Linux Enterprise Server to the Network.
TCP/IP Protocol Suite 1 Chapter 6 Upon completion you will be able to: Delivery, Forwarding, and Routing of IP Packets Understand the different types of.
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.
HALP! Something is in my tubes! Part I by Jason Testart, IST.
07/11/ L10/1/63 COM342 Networks and Data Communications Ian McCrumRoom 5B18 Tel: voice.
Networking ● Networking uses the TCP/IP protocol by default, but Linux can use other protocols to interact with other operating systems: MS Networking.
PA3: Router Junxian (Jim) Huang EECS 489 W11 /
Page 1 COMP210 Network layer. Page 2 The Network Layer  The network layer is responsible for establishing, maintaining and terminating connections 
Objectives Configure routing in Windows Server 2008 Configure Routing and Remote Access Services in Windows Server 2008 Network Address Translation 1.
IP Forwarding.
1 IP: putting it all together Part 1 G53ACC Chris Greenhalgh.
Copyright © Lopamudra Roychoudhuri
IPSec in a Multi-OS Environment. What is IPSec? IPSec stands for Internet Protocol Security It is at a most basic level a way of adding security to your.
1 Tutorial 6: Networking Utilities & Firewall. 2 Internet Control Message Protocol (ICMP) designed to compensate for the deficiencies of IP protocol.
© Jörg Liebeherr (modified by M. Veeraraghavan) 1 ICMP: A helper protocol to IP The Internet Control Message Protocol (ICMP) is the protocol used for error.
Delivery, Forwarding, and Routing of IP Packets
Dr. Clincy1 Chapter 6 Delivery & Forwarding of IP Packets Lecture #4 Items you should understand by now – before routing Physical Addressing – with in.
1 實驗九:建置網路安全閘道器 教師: 助教:. 2 Outline  Background  Proxy – Squid  Firewall – IPTables  VPN – OpenVPN  Experiment  Internet gateway  Firewall  VPN.
System Troubleshooting TCS Network, System, and Load Monitoring TCS for Developers.
TCP/IP Protocols Contains Five Layers
1 Internet Tool Practice 한두균 송정환
Junos Intermediate Routing
Le firewall Technofutur. Table des matières Schémas du réseau Routage sans VPN Routage avec VPN Le NAT Le firewall.
2010 paro, bhutan IP Basics IP/ISP Services Workshop July, 2010 Paro, Bhutan.
Linux Setting up your network. Basic Approaches Configure during installation –Disadvantage -> not able to redo easily –Advantage-> holds your hand Configure.
IPv6 – The Future Of The Internet Redbrick Networking Conference 26 March 2003 Dave Wilson DW238-RIPE.
IP network tools & troubleshooting AFCHIX 2010 Nairobi, Kenya October 2010.
FreeS/WAN & VPN Cory Petkovsek VPN: Virtual Private Network – a secure tunnel through untrusted networks. IP Security (IPSec): a standardized set of authentication.
Using Routing and Remote Access Chapter Five. Exam Objectives in this Chapter:  Plan a routing strategy Identify routing protocols to use in a specified.
Securing Data Transmission and Authentication. Securing Traffic with IPSec IPSec allows us to protect our network from within IPSec secures the IP protocol.
1 Kyung Hee University Chapter 6 Delivery Forwarding, and Routing of IP Packets.
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 4: Planning and Configuring Routing and Switching.
BNL PDN Enhancements. Perimeter Load Balancers Scaleable Performance Fault Tolerance Server Maintainability User Convenience Perimeter Security.
Linux Operations and Administration Chapter Eight Network Communications.
1 Lecture 13 IPsec Internet Protocol Security CIS CIS 5357 Network Security.
V IRTUAL P RIVATE N ETWORKS K ARTHIK M OHANASUNDARAM W RIGHT S TATE U NIVERSITY.
CSN09101 Networked Services Week 5 : Networking
Fall 2011 Nassau Community College ITE153 – Operating Systems 1 Session 9 Networking & Operating Systems (part 2)
1 COMP 431 Internet Services & Protocols The IP Internet Protocol Jasleen Kaur April 21, 2016.
UDP. User Datagram Protocol (UDP)  Unreliable and unordered datagram service  Adds multiplexing  No flow control  Endpoints identified by ports 
Ifconfig Kevin O'Brien Washtenaw Linux Users Group
Network and System Security Risk Assessment
Linux network troubleshooting
Instructor Materials Chapter 6: Network Layer
ELA: A Fully Distributed VPN over P2P Network
Setting Up Firewall using Netfilter and Iptables
Delivery, Forwarding, and Routing of IP Packets
See Next Slide Example 13 (continued)
Virtual Private Network
Presentation transcript:

Installing and running FreeS/WAN

What is FreeS/WAN An implementation of IpSec for Linux –Can be found at Helps setup encrypted and/or authenticated communications in –Network-Network –Host-network –Host-Host configurations

The tested FreeS/WAN Configuration (network-network) (eth0) beta alpha (“right”) (“ rightnexthop ”) (eth1) titan lamar (“left”) (“ leftnexthop ”) (eth1) (eth0) “Left Subnet” “Right Subnet” IpSec Tunnel

How to get IPSec to work Start with the physical setup of machines – identify the gateways, the subnets, the gateway interface on which the subnets exist. Identify (arbitrarily) which is “left” and which is “right”. If Using private subnets, the Ids should not conflict. (Might have to use NAT if they have to conflict, but that is for another day). Make the appropriate entries in the routing tables. Download and build freeS/WAN per the instructions in chapter 6 of “Building Linux Virtual Private Networks” by Oleg Kolesnikov and Brian Hatch. Generate keys on both gateways, using PSK or RSA. Store these keys in /etc/ipsec.secrets on each gateway. RSA was used in this case. Command used was “ipsec rsasigkey –verbose 2048 > rsakey.tmp”. Add the formatting information and copy into /etc/ipsec.secrets.

How to get IPSec to work (contd) Enter details of the connection name, interface, left and right subnets, nexthops and gateways into /etc/ipsec.conf. Make sure all lines below the label line start with a tab. ( ! Even comments should start with a tab !). For the network-network configuration, copy the same /etc/ipsec.conf file into both machines. (This means, ‘left’ is left and “right” is right. whatever gateway you are looking at). Note that this will not be the case for “host-network”. Copy the ‘value of the #pubkey from both /etc/ipsec.secrets files into /etc/ipsec.conf files appropriately. To establish connection, run ipsec auto --up connectName on both sides.

How an IPSec packet looks The IpSec module on the gateway encapsulates the original payload to look like the following when sending a packet out. When receiving a packet, the gateway reads the IpSec header, performs decryption etc which results in the original packet. New IP Header IpSec Header (AH or ESP) Old IP HeaderPayload Original payload, now encrypted

Routing table on alpha Destination Gateway Genmask Flags Metric Ref Use Iface U eth U ipsec UG ipsec U eth U lo UG eth1

Routing table on lamar Destination Gateway Genmask Flags Metric Ref Use Iface U eth U ipsec U eth UG ipsec U lo UG eth1

Firewall rules on lamar iptables -F echo "Setting ip_forward to 1..." echo 1 > /proc/sys/net/ipv4/ip_forward echo "Setting rp_filter's to 0..." for i in `find /proc/sys/net/ipv4/conf -name rp_filter` do echo 0 > $i done /sbin/iptables -P FORWARD ACCEPT /sbin/iptables -P FORWARD DROP # Only allow ipsec traffic, ESP and AH from and to the Internet /sbin/iptables -A FORWARD -p udp -d /24 --dport 500 -j ACCEPT ### Suggestion: "-o IF-of /32".

Firewall rules on lamar (contd) /sbin/iptables -A FORWARD -p 50 -d /24 -j ACCEPT ### Suggestion: "-o IF-of /32". /sbin/iptables -A FORWARD -p 51 -d /24 -j ACCEPT ### Suggestion: "-o IF-of /32". # Allows internal subnet access /sbin/iptables -A FORWARD -s /24 -j ACCEPT ### Suggestion: "-i IF-of /24". # Allows traffic from and to internal LANs /sbin/iptables -A FORWARD -s /24 -d /24 -j ACCEPT ### Suggestion: "-o IF-of /24". Suggestion: "-i IF-of /24". /sbin/iptables -A FORWARD -d /24 -s /24 -j ACCEPT ### Suggestion: "-o IF-of /24". Suggestion: "-i IF-of /24". # Default input policy back to DROP /sbin/iptables -P FORWARD DROP The firwall rules for alpha are the mirror image of these.

The /etc/ipsec.conf used - 1 # /etc/ipsec.conf - FreeS/WAN IPsec configuration file # More elaborate and more varied sample configurations can be found # in FreeS/WAN's doc/examples file, and in the HTML documentation. # basic configuration config setup # THIS SETTING MUST BE CORRECT or almost nothing will work; # %defaultroute is okay for most simple cases. interfaces="ipsec0=eth1" # Debug-logging controls: "none" for (almost) none, "all" for lots. klipsdebug=all plutodebug=all # Use auto= parameters in conn descriptions to control startup actions. plutoload=%search plutostart=%search # Close down old connection when new one using same ID shows up. # uniqueids=yes

The /etc/ipsec.conf used - 2 #conn %default conn a2l keyingtries=0 # sample VPN connection # Left security gateway, subnet behind it, next hop toward right. left= leftsubnet= /24 leftnexthop= # Right security gateway, subnet behind it, next hop toward left. right= rightsubnet= /24 rightnexthop= # To authorize this connection, but not actually start it, at startup, # uncomment this. auto=start authby=rsasig leftrsasigkey=0sAQOSxZRaWBqt.. rightrsasigkey=0sAQNvPwFQ…

Evidence of IPSec tunnel ifconfig (on titan) eth1 Link encap:Ethernet HWaddr 00:A0:24:0B:2C:05 inet addr: Bcast: Mask: UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:11748 errors:0 dropped:0 overruns:0 frame:0 TX packets:11669 errors:0 dropped:0 overruns:0 carrier:1 collisions:1 txqueuelen:100 RX bytes: (2.3 Mb) TX bytes: (3.2 Mb) Interrupt:10 Base address:0x1020 root]# ping PING ( ) from : 56(84) bytes of data. 64 bytes from : icmp_seq=1 ttl=62 time=4.17 ms 64 bytes from : icmp_seq=2 ttl=62 time=3.98 ms 64 bytes from : icmp_seq=3 ttl=62 time=4.12 ms 64 bytes from : icmp_seq=4 ttl=62 time=4.14 ms 64 bytes from : icmp_seq=5 ttl=62 time=4.14 ms 64 bytes from : icmp_seq=6 ttl=62 time=3.99 ms

Evidence of IPSec tunnel (contd) Ifconfig (on beta) eth0 Link encap:Ethernet HWaddr 00:60:B0:A2:81:D5 inet addr: Bcast: Mask: UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:37808 errors:0 dropped:0 overruns:0 frame:0 TX packets:12890 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes: (5.6 Mb) TX bytes: (1.2 Mb) Interrupt:9 Base address:0xfcc0 root]# ping PING ( ) from : 56(84) bytes of data. 64 bytes from : icmp_seq=1 ttl=62 time=3.85 ms 64 bytes from : icmp_seq=2 ttl=62 time=3.88 ms 64 bytes from : icmp_seq=3 ttl=62 time=3.85 ms 64 bytes from : icmp_seq=4 ttl=62 time=3.88 ms 64 bytes from : icmp_seq=5 ttl=62 time=3.87 ms