您现在的位置: 万盛学电脑网 >> 电脑基础 >> 电脑入门 >> 正文

基于OpenVPN连接两个远程局域网段 电脑技术吧

作者:佚名    责任编辑:admin    更新时间:2022-06-22

基于OpenVPN连接两个远程局域网段
 
 
 
系统环境:
 
    服务端:RHEL5 [ 2.6.18-8.el5xen ] 
 
  
 
软件环境:
 
    http://openvpn.net/release/openvpn-2.0.9.tar.gz
 
    http://openvpn.se/files/install_packages/openvpn-2.0.9-gui-1.0.3-install.exe
 
    http://www.oberhumer.com/opensource/lzo/download/lzo-2.03.tar.gz 
 
  
 
参考文档:
 
    http://openvpn.net/index.php/documentation/howto.html
 
    http://www.linux.com/articles/58336 
目标功能:
 
    搭建OpenVPN服务器,跨越Internet连接两个异地的局域网段。 
 
  
 
              |---------------| <-->   Internet  <--> |---------------|
 
    LAN2 <--> |Router2(Client)|                       |Router1(Server)| --> LAN1
 
              |---------------| <--> SSL VPN Tun <--> |---------------| 
 
  
 
    (北京)Server(router1)网络参数:
 
        eth0 173.16.16.1/24
 
        eth1 192.168.20.1/24(本例中作为LAN1的网关)
 
        LAN1:192.168.20.0/24 
 
  
 
    (广州)Client(router2)网络参数:
 
        eth0 211.20.20.1/24
 
        eth2 192.168.40.1/24(本例中作为LAN2的网关)
 
        LAN2:192.168.40.0/24 
 
####################################################################
 
一、安装OpenVPN软件包 (在router1、router2上均执行以下操作,按默认配置安装到/usr/local目录下)   
 
  
 
    1、安装lzo (为SSL数据提供压缩)
 
shell> tar zxvf lzo-2.03.tar.gz -C /usr/src
 
shell> cd /usr/src/lzo-2.03
 
shell> ./configure && make && make install 
 
  
 
    2、安装openvpn
 
shell> tar zxvf openvpn-2.0.9.tar.gz -C /usr/src
 
shell> cd /usr/src/openvpn-2.0.9
 
shell> ./configure && make && make install