VPN(Virtual Private Network)

Virtual Private Networks (VPNs) are used to ensure the security of data across the Internet. A VPN is used to create a private tunnel over a public network. Data can be secured by using encryption in this tunnel through the Internet and by using authentication to protect data from unauthorized access.

1. VPNs

The first VPNs were strictly IP tunnels that did not include authentication or encryption of the data. Generic Routing Encapsulation (GRE) is a tunneling protocol developed by Cisco that can encapsulate a wide variety of network layer protocol packet types inside IP tunnels. This creates a virtual point-to-point link to Cisco routers at remote points over an IP internetwork.

The benefits of a VPN include the following:

  • Cost savings - VPNs enable organizations to use cost-effective, third-party Internet transport to connect remote offices and remote users to the main site; therefore, eliminating expensive, dedicated WAN links and modem banks. Furthermore, with the advent of cost-effective, high-bandwidth technologies, such as DSL, organizations can use VPNs to reduce their connectivity costs while simultaneously increasing remote connection bandwidth.
  • Scalability - VPNs enable organizations to use the Internet infrastructure within ISPs and devices, which makes it easy to add new users. Therefore, organizations are able to add large amounts of capacity without adding significant infrastructure.
  • Compatibility with broadband technology - VPNs allow mobile workers and telecommuters to take advantage of high-speed, broadband connectivity, such as DSL and cable, to access to their organizations’ networks. Broadband connectivity provides flexibility and efficiency. High-speed, broadband connections also provide a cost-effective solution for connecting remote offices.
  • Security - VPNs can include security mechanisms that provide the highest level of security by using advanced encryption and authentication protocols that protect data from unauthorized access.

There are two types of VPN networks:

  • site-to-site
  • remote-access

Site-to-Site VPN

A site-to-site VPN is created when devices on both sides of the VPN connection are aware of the VPN configuration in advance.  The VPN remains static, and internal hosts have no knowledge that a VPN exists. In a site-to-site VPN, end hosts send and receive normal TCP/IP traffic through a VPN “gateway”. The VPN gateway is responsible for encapsulating and encrypting outbound traffic for all traffic from a particular site. The VPN gateway then sends it through a VPN tunnel over the Internet to a peer VPN gateway at the target site. Upon receipt, the peer VPN gateway strips the headers, decrypts the content, and relays the packet toward the target host inside its private network.

A site-to-site VPN is an extension of a classic WAN network. Site-to-site VPNs connect entire networks to each other, for example, they can connect a branch office network to a company headquarters network. In the past, a leased line or Frame Relay connection was required to connect sites, but because most corporations now have Internet access, these connections can be replaced with site-to-site VPNs.

Remote-access VPNs

Where a site-to-site VPN is used to connect entire networks, a remote-access VPN supports the needs of telecommuters, mobile users, and extranet, consumer-to-business traffic. A remote-access VPN is created when VPN information is not statically set up, but instead allows for dynamically changing information, and can be enabled and disabled. Remote-access VPNs support a client/server architecture, where the VPN client (remote host) gains secure access to the enterprise network via a VPN server device at the network edge.

Remote-access VPNs are used to connect individual hosts that must access their company network securely over the Internet. Internet connectivity used by telecommuters is typically a broadband, DSL, wireless, or cable connection.

VPN client software may need to be installed on the mobile user’s end device; for example, each host may have Cisco AnyConnect Secure Mobility Client software installed. When the host tries to send any traffic, the Cisco AnyConnect VPN Client software encapsulates and encrypts this traffic. The encrypted data is then sent over the Internet to the VPN gateway at the edge of the target network. Upon receipt, the VPN gateway behaves as it does for site-to-site VPNs.

2. Site-to-Site GRE Tunnels

GRE has these characteristics:

  • GRE is defined as an IETF standard (RFC 2784).
  • In the outer IP header, 47 is used in the protocol field to indicate that a GRE header will follow.
  • GRE encapsulation uses a protocol type field in the GRE header to support the encapsulation of any OSI Layer 3 protocol. Protocol Types are defined in RFC 1700 a "EtherTypes".
  • GRE itself is stateless; by default it does not include any flow-control mechanisms.
  • GRE does not include any strong security mechanisms to protect its payload.
  • The GRE header, together with the tunneling IP header indicated in the figure, creates at least 24 bytes of additional overhead for tunneled packets.

GRE Configurtions:

step 1:  配置接口
R1 loopback 0 : 1.1.1.1/24

R1 s1/0 1.1.12.1/24

R2 s1/0 1.1.12.2/24

R2 s1/1 1.1.23.2/24

R3 s1/1 1.1.23.3/24

R3 loopback 0: 3.3.3.3/24

Step 2: 配置路由

R1(config)#ip route 0.0.0.0 0.0.0.0 s1/0

R3(config)#ip route 0.0.0.0 0.0.0.0 s1/1

Step 3: 配置 tunnel  接口

R1(config)#interface tunnel 0

R1(config-if)#tunnel mode gre ip

R1(config-if)#ip address 192.168.2.1 255.255.255.0

R1(config-if)#tunnel source 1.1.12.1

R1(config-if)#tunnel destination 1.1.23.3

R3(config)#interface tunnel 0

R3(config-if)#tunnel mode gre ip

R3(config-if)#ip address 192.168.2.2 255.255.255.0

R3(config-if)#tunnel source 1.1.23.3

R3(config-if)#tunnel destination 1.1.12.1

Step 4: 配置loopback 路由

R1(config)#router ospf 1

R1(config-router)#network 1.1.1.0 0.0.0.255 area 0

R3(config)#router ospf 1

R3(config-router)#network 3.3.3.0 0.0.0.255 area 0

测试:

R1#ping 3.3.3.3 sou lo 0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/24/32 ms

时间: 2024-08-06 11:17:42

VPN(Virtual Private Network)的相关文章

虚拟专用网(VPN,Virtual Private Network)

1.VPN的用途 代理服务器Proxy Server,其功能就是代理网络用户去取得网络信息.形象的说:它是网络信息的中转站. 与代理服务器不同.VPN是解决通过外网访问内网资源的一种远程连接方式,如下面的情况: (1)公司出差员工,可以通过vpn登陆公司内网进行办公: (2)各个分公司可以通过vpn与总公司联系: 2.什么是VPN VPN就是利用开放的公众IP/MPLS网络建立专用数据传输通道,将远程的分支机构.移动办公人员等连接起来. V(Virtual): 虚拟通道,不需要专用线路. P(P

区块链入门(2):搭建以太坊私有链(private network of ethereum),以及挖矿的操作..

在做一些测试工作的时候, 为了方便控制以及更快的进入真正的测试工作,可能需要搭建一个私有的以太坊网络. 而以太坊节点之间能够互相链接需要满足1)相同的协议版本2)相同的networkid,所以搭建私有网络最方便的方法就是通过geth命令中的--networkid选项,设置一个与主网不同的networkid(主网的networkid为1),这也是官方推荐的方法. 下面开始建立私有以太坊网络: mkdir private-geth cd private-geth 建立创世纪区块文件,是一个json格

11g新特性 -- Virtual Private Catalogs

在oracle 11g之前版本中,如果用户只是需要访问recovery catalog 中的某个数据库,但是我们却只能将整个recovery catalog授权给他,无法做到严格限制. 现在,virtual private cataglog提供了严格的访问权限控制,使得用户可以只是访问catalog中的部分数据库. virtual private cataglog也叫做virtual catalog. 可以为一个用户或者多个用户创建virtual catalog.这时,整个集中化的catalog

Neutron 理解 (6): Neutron 是怎么实现虚拟三层网络的 [How Neutron implements virtual L3 network]

学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GRE/VxLAN 虚拟网络 (4)Neutron OVS OpenFlow 流表 和 L2 Population (5)Neutron DHCP Agent (6)Neutron L3 Agent (7)Neutron LBaas Neutron 对虚拟三层网络的实现是通过其 L3 Agent (ne

VPS 虚拟私有主机 Virtual Private Server

VPS技术介绍 利用最新虚拟化技术Xen在一台物理服务器上创建多个相互隔离的虚拟私有主机(“Virtual Private Server”简称 “VPS”).这些VPS以最大化的效率共享硬件.软件许可证以及管理资源.对其用户和应用程序来讲,每一个VPS平台的运行和管理都与一台独立主机完全相同,因为每一个VPS均可独立进行重启并拥有自己的root访问权限.用户.IP地址.内存.过程.文件.应用程序.系统函数库以及配置文件.对于运行着多个应用程序和拥有实际数据的产品服务器来说,Xen的低成本消耗和高

VPS(Virtual Private Server 虚拟专用服务器)[转自百度]

系统选择 vps上常用的操作系统是linux(有多种发行版).freeBSD,windows server等.一般来说,vps的操作系统不是自由安装的,linux系列vps可以安装多个linux发行版,但不能装windows:相对,windows系列vps也不能改装linux. 这点在购买时要首先考虑,根据你的需求确定买哪种vps. 笔者强烈推荐使用linux:linux效率高,对硬件配置要求低:安全性高:不需要运行图形界面.可以自由精简不必要的功能.节约下来的系统资源用来跑应用:丰富多样的网络

搭建vps(virtual private station)之Github教育礼包之DigitalOcean

最近Github联合很多业内厂商给出了一份学生礼包,可以用来做很多事情,其中包括Digital Ocean的100$优惠,用他可以架设自己的云服务器,选择每月5$套餐可获得512Mb内存20g固态硬盘1T流量的虚拟机,架个vpn看YouTube一点不卡.这里介绍一下申请流程: 1.首先打开这里注册教育邮箱(.edu.cn尾名),可点击“get your pack”,过了一会刷新页面就可以看到digitalocean可以领取优惠码. 2.领取完优惠码后可点击我的推广链接,这样可以多得10$,当然博

CodeBuild 与 Amazon Virtual Private Cloud 结合使用

通常,AWS CodeBuild 无法访问 VPC 中的资源.要支持访问,您必须提供额外的 VPC 特定配置信息以作为 CodeBuild 项目配置的一部分.这包括 VPC ID.VPC 子网 ID 和 VPC 安全组 ID.支持 VPC 的构建随后就可以访问 VPC 内的资源. 来自 AWS CodeBuild 构建的 VPC 连接使以下操作成为可能: 通过您的构建对私有子网上隔离的 Amazon RDS 数据库中的数据运行集成测试. 直接通过测试查询 Amazon ElastiCache 集

setting up a IPSEC/L2TP vpn on CentOS 6 or Red Hat Enterprise Linux 6 or Scientific Linux

This is a guide on setting up a IPSEC/L2TP vpn on CentOS 6 or Red Hat Enterprise Linux 6 or Scientific Linux 6 using Openswan as the IPsec server, xl2tpd as the l2tp provider and ppp for authentication. We choose the IPSEC/L2TP protocol stack because