Debian 下绑定双网卡,添加vlan并配置IP

双网卡: eth0,  eth1

VLan:   vlan316

bond:  绑定网卡eth0和eth1为bond1 

           常用的有三种

           mode=0:平衡负载模式,有自动备援,但需要”Switch”支持。

           mode=1:自动备援模式,其中一条线若断线,其他线路将会自动备援。

           mode=6:平衡负载模式,有自动备援。

一、安装Vlan相关的包

     # apt-get install vlan ifenslave

二、加载模块

    # modprobe 8021q

    # echo "8021q" >> /etc/modules

    # echo "bonding" >>/etc/modules

三、 配置bond

     # vim  /etc/network/interfaces   添加以下内容:

     auto bond1
        iface bond1 inet manual
        bond-mode 1
        bond-miimon 100
        bond_xmit_hash_policy layer2+3
        bond_lacp_rate slow
        slaves eth0 eth1

四、配置Vlan并绑定IP

      #vim  /etc/network/interfaces   添加以下内容:

      auto vlan314
        iface vlan314 inet static
        vlan_raw_device bond1
        address 10.172.1.226
        netmask 255.255.255.224
        #添加路由
        up ip route add 114.114.114.114 via 10.172.1.254
        down ip route del 114.114.114.114 via 10.172.1.254

转载于:https://my.oschina.net/kztxt/blog/3057872

猜你喜欢

转载自blog.csdn.net/weixin_33796177/article/details/91680973
今日推荐