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

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

        }

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

转载于:https://my.oschina.net/xnhmPwjJmc/blog/503688

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值