码迷,mamicode.com
首页 > 其他好文 > 详细

使用 vtun bridge建立远程多对多虚拟网络

时间:2015-09-09 13:39:13      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:

debug server :
    环境 utbuntu 14.04

    安装必须软件
    apt-get install isc-dhcp-server vtun bridge-utils


    修改 /etc/network/interfaces 增加调试用借口
    iface debug0 inet static
        address 10.254.0.1
        netmask 255.255.0.0
        pre-up brctl addbr debug0


    配置isc-dhcp服务器,使得为debug0接口开启dhcp server
    修改 /etc/default/isc-dhcp-server
    配置 INTERFACES="debug0"

    vi /etc/dhcp/dhcpd.conf
    修改dhcpd的地址范围等信息
    在 /etc/dhcp/dhcpd.conf 中增加

        subnet 10.254.0.0 netmask 255.255.0.0 {
          range 10.254.0.10 10.254.255.254;
          option broadcast-address 10.254.255.255;
          default-lease-time 600;
          max-lease-time 7200;
        }

    重启 服务
        /etc/init.d/isc-dhcp-server restart


    修改vtun运行模式:
         vi /etc/default/vtun
         确认 RUN_SERVER=yes

     修改vtun配置

         vi /etc/vtund.conf

         建立自己的配置项目:
         如下


            options {
              port 8090;            # Listen on this port.

              # Syslog facility
              syslog        daemon;
            }

            # Default session options
            default {
              compress no;          # Compression is off by default
              encrypt no;
            }

            BeeOSDebug {
              passwd  aaaaa;        # Password
              type  ether;          # ether tunnel
              proto udp;            # udp protocol
              keepalive yes;        # Keep connection alive
              compress no;
              encrypt  yes;
             }


openwrt或其他linux下建立vtun client

    在 /etc/config/network 中添加
        config interface ‘lan_debug‘
            option ifname ‘tap0‘
            option macaddr ‘00:11:fc:10:10:11‘
            option proto ‘dhcp‘

    建立client配置文件
        options {
          port 8090;        # Connect to this port.
          timeout 5;        # General timeout
        }

        # TUN example. Session ‘cobra‘.
        BeeOSDebug {
          passwd  aaaaa;    # Password
         
          keepalive yes;
           
          persist yes;        # Persist mode

        }

    最后自行编写启动和停止文件即可

使用 vtun bridge建立远程多对多虚拟网络

标签:

原文地址:http://my.oschina.net/u/1475504/blog/503688

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!