zhoujun.g 发表于 2018-10-17 07:59:39

ubuntu server 10.4下Open***(路由模式)实验

  前言:
  在ubuntu server 10.4下做完Open***的桥接模式实验后,这次做路由模式的实验,Open***分两种模式,即桥接模式与路由模式,先看一下这两种模式有什么不同。

  以上内容网上都有,我只是把它们整理成表格的形式,更易对比,便于理解。
  实验环境:
  (1)拓朴图:

  (2)两台路由器用Dynamips模拟器模拟,VNET为VMware Workstation 7.0添加的两块VMware Network Adapter。
  (3)Open***服务器为Ubuntu server 10.4,open***软件包。客户端这次使用Ubuntu 桌面版10.4,open***软件包。
  (4)这个环境的搭建方法见http://xuchengji.blog.51cto.com/160472/473766(ubuntu server 10.4下Open***的桥接模式实验)
  Open***服务器端配置:
  (1)安装open***:
  #sudo apt-get install open***
  #sudo mkdir /etc/open***/easy-rsa/
  #sudo cp -R /usr/share/doc/open***/examples/easy-rsa/2.0/* /etc/open***/easy-rsa/
  (2) #sudo vim /etc/open***/easy-rsa/vars 做以下修改

  因为在/etc/open***/easy-rsa/vars里有以下设置

  所以要在/etc/open***/easy-rsa/下建立keys这个目录,做为证书的输出目录。
  #sudo mkdir /etc/open***/easy-rsa/keys
  (3)创建服务器端证书
  #cd /etc/open***/easy-rsa/
  #sudo chown -R root:admin .
  #sudo chmod g+w .
  #source ./vars
  #./clean-all
  #./build-dh
  #./pkitool –-initca
  #./pkitool --server server(最后一个server为服务端的证书名)
  #cd keys
  #open*** --genkey --secret ta.key
  #sudo cp server.crt server.key ca.crt dh1024.pem ta.key /etc/open***
  (4)配置open***服务
  #sudo cp/usr/share/doc/open***/examples/sample-config-files/server.conf.gz/etc/open***
  #cd /etc/open***
  #sudo gzip –d server.conf.gz
  #sudo vim server.conf

  在默认情况下,open***的配置文件就是路由模式的,所以只需稍做修改即可。
  #sudo /etc/init.d/open*** restart
  #ifconfig

  tun0的IP为:192.168.6.1
  (5) 创建客户端证书和密钥
  #cd /etc/open***/easy-rsa/
  #source ./vars
  #./pkitool ub104(ub104为客户端证书名)
  会产生ub104.crt,ub104.key两个文件。
  open***客户端配置
  #sudo apt-get install open***
  #sudo cp /usr/share/doc/open***/examples/sample-config-files/client.conf /etc/open***
  #sudo vim /etc/open***/client.conf

  #sudo /etc/init.d/open*** restart
  #ifconfig

  结束语:
  由于这个实验环境的限制,没有做open***客户端能否访问与open***服务器在同一网段内的其它机器,网上也有此问题解决方法,比如开启open***服务器的路由功能,把open***服务器当做其它机器的网关,给open***客户端添加相应的路由。在生产环境中实施这一方案时,当然是先配置好,然后实际操作,进行测试,修正问题,成功后再实施。路由模式比桥接模式配置上就是少了一步桥接,其它配置基本相同。

页: [1]
查看完整版本: ubuntu server 10.4下Open***(路由模式)实验