zoukankan      html  css  js  c++  java
  • [转]linux VLAN配置(vconfig)

    1.安装vlan(vconfig)和加载8021q模块

    #aptitude install vlan
    #modprobe 8021q

    2.使用linux vconfig命令配置vlan

    #vconfig add eth0 100
    #vconfig add eth0 200

    在eth0接口上配置两个VLAN

    #vconfig set_flag eth0.100 1 1
    #vconfig set_flag eth0.200 1 1

    设置VLAN的REORDER_HDR参数,默认就行了。

    可以使用cat /proc/net/vlan/eth0.100查看eth0.100参数

    #ifconfig eth0 0.0.0.0
    #ifconfig eth0.100 192.168.100.50 netmask 255.255.255.0 up
    #ifconfig eth0.200 192.168.200.50 netmask 255.255.255.0 up

    配置网络信息

    #vconfig rem eth0.100
    #vconfig rem eth0.200

    删除VLAN命令

    3.将VLAN信息写入配置文件

    #echo "modprobe 8021q">>/etc/rc.local

    开机加载8021q模块,或者使用echo "8021q">>/etc/modules

    #cp /etc/network/interfaces /etc/network/interfaces.default
    #vim /etc/network/interfaces
    auto lo eth0
    iface lo inet loopback
    iface eth0.100 inet static
        address 192.168.100.50
        netmask 255.255.255.0
    iface eth0.200 inet static
        address 192.168.200.50
        netmask 255.255.255.0

  • 相关阅读:
    矿Mac必备软件
    PHP第六课 使用方法数组
    I/O概述和审查操作
    应用程序配置文件
    他毕业两年,博客一年,时间
    苹果公司的回复
    CImage类的介绍与使用
    数据库移植遇到的问题
    MP算法和OMP算法及其思想
    ROR 环境的 搭建
  • 原文地址:https://www.cnblogs.com/popsuper1982/p/3803700.html
Copyright © 2011-2022 走看看