zoukankan      html  css  js  c++  java
  • vconfig in linux

    % vconfig
    Expecting argc to be 3-5, inclusive.  Was: 1
    
    Usage: add             [interface-name] [vlan_id]
           rem             [vlan-name]
           set_flag        [interface-name] [flag-num]       [0 | 1]
           set_egress_map  [vlan-name]      [skb_priority]   [vlan_qos]
           set_ingress_map [vlan-name]      [skb_priority]   [vlan_qos]
           set_name_type   [name-type]
    
    * The [interface-name] is the name of the ethernet card that hosts
      the VLAN you are talking about.
    * The vlan_id is the identifier (0-4095) of the VLAN you are operating on.
    * skb_priority is the priority in the socket buffer (sk_buff).
    * vlan_qos is the 3 bit priority in the VLAN header
    * name-type:  VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5),
                  DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5)
    * bind-type:  PER_DEVICE  # Allows vlan 5 on eth0 and eth1 to be unique.
                  PER_KERNEL  # Forces vlan 5 to be unique across all devices.
    * FLAGS:  1 REORDER_HDR  When this is set, the VLAN device will move the
                ethernet header around to make it look exactly like a real
                ethernet device.  This may help programs such as DHCPd which
                read the raw ethernet packet and make assumptions about the
                location of bytes.  If you don't need it, don't turn it on, because
                there will be at least a small performance degradation.  Default
                is OFF.
    
    ----->   在eth0接口配置两个vlan  如果没有加载模块会自动加载8021q模块
    vconfig add eth0 11
    vconfig add eth0 21
    
    ----->   设置参数 REORDER_HDR (默认就是)
    vconfig set_flag eth0.11 1 1
    vconfig set_flag eth0.21 1 1
    
    ----->   查看一下
    cat /proc/net/vlan/eth0.11
    cat /proc/net/vlan/eth0.21
    
    ----->   改接口启动配置文件
    cd /etc/sysconfig/network-scripts/
    cp ifcfg-eth0 ifcfg-eth0.11
    perl -pi -e 's/DEVICE=eth0/DEVICE=eth0.11/g' ifcfg-eth0.11
    cp ifcfg-eth0 ifcfg-eth0.21
    perl -pi -e 's/DEVICE=eth0/DEVICE=eth0.21/g' ifcfg-eth0.21
    
    perl -pi -e 's/IPADDR=/#IPADDR=/g' ifcfg-eth0
    perl -pi -e 's/NETMASK=/#NETMASK=/g' ifcfg-eth0
    ......
    
    ----->   手工切换 这时需要更改交换机配置
    ifdown eth0;ifup eth0;ifup eth0.11;ifup eth0.21
    
    ----->   设置下次启动自动加载 8021q 模块
    echo VLAN=yes >> /etc/sysconfig/network
    
  • 相关阅读:
    一些有用的DNN方法
    将VB.Net反编译时StringType.StrCmp用C#中的函数string.Compare替换
    接一个DNN安装时的未知错误,终于找到了原因
    这是用performancing for firefox编写的blog
    这是用word2007发表的blog
    一个DNN安装时的未知错误
    后端——框架——切面框架——aop——Pointcut表达式
    Metroid Prime Chs 20101004
    第一财经周刊:书店的黄昏
    这年头连萝卜都靠不住了
  • 原文地址:https://www.cnblogs.com/BloodAndBone/p/1946179.html
Copyright © 2011-2022 走看看