linux VLAN配置(vconfig)
来源:互联网 发布:广告投放算法 编辑:程序博客网 时间:2024/05/18 03:58
1.安装vlan(vconfig)和加载8021q模块
#aptitude install vlan
#modprobe 8021q
或:
#yum install vconfig
#modprobe 8021q
#lsmod |grep -i 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
======================================================
VCONFIG(8) VCONFIG(8)
NAME
vconfig - VLAN (802.1q) configuration program.
SYNOPSIS
vconfig [lots of long options]
DESCRIPTION
The vconfig program allows you to create and remove vlan-devices on a vlan enabled kernel. Vlan-devices are virtual ethernet devices
which represents the virtual lans on the physical lan.
OPTIONS
add [interface-name] [vlan-id]
Creates a vlan-device on [interface-name]. The resulting vlan-device will be called according to the nameing convention set.
rem [vlan-device]
Removes the named vlan-device.
set_flag [vlan-device] 0 | 1
When 1, ethernet header reorders are turned on. Dumping the device will appear as a common ethernet device without vlans. When
0(default) however, ethernet headers are not reordered, which results in vlan tagged packets when dumping the device. Usually
the default gives no problems, but some packet filtering programs might have problems with it.
set_egress_map [vlan-device] [skb-priority] [vlan-qos]
This flags that outbound packets with a particular skb-priority should be tagged with the particular vlan priority vlan-qos.
The default vlan priority is 0.
set_ingress_map [vlan-device] [skb-priority] [vlan-qos]
This flags that inbound packets with the particular vlan priority vlan-qos should be queued with a particular skb-priority. The
default skb-priority is 0.
set_name_type VLAN_PLUS_VID | VLAN_PLUS_VID_NO_PAD | DEV_PLUS_VID | DEV_PLUS_VID_NO_PAD
Sets the way vlan-device names are created. Use vconfig without arguments to see the different formats.
NOTES VLAN will use Broadcom’s NICE interface when the network device supports it. This is necessary, since usually the hardware of
these devices already removes the vlan tag from the ethernet packet. The set_flag option on vlan-devices created on such a
physical network device will be ignored. Dumping the network-device will show only untagged(non-vlan) traffic, and dumping the
vlan-devices will only show traffic intended for that vlan, without the tags.
FILES
/proc/net/vlan/config
/proc/net/vlan/[vlan-device]
SEE ALSO
ip(8), ifconfig(8)
AUTHORS
This manual page was written by Ard van Breemen <ard@kwaak.net>
The vlan patch is written by Ben Greear <greearb@candelatech.com>
VCONFIG(8)
(END)
#aptitude install vlan
#modprobe 8021q
或:
#yum install vconfig
#modprobe 8021q
#lsmod |grep -i 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
======================================================
VCONFIG(8) VCONFIG(8)
NAME
vconfig - VLAN (802.1q) configuration program.
SYNOPSIS
vconfig [lots of long options]
DESCRIPTION
The vconfig program allows you to create and remove vlan-devices on a vlan enabled kernel. Vlan-devices are virtual ethernet devices
which represents the virtual lans on the physical lan.
OPTIONS
add [interface-name] [vlan-id]
Creates a vlan-device on [interface-name]. The resulting vlan-device will be called according to the nameing convention set.
rem [vlan-device]
Removes the named vlan-device.
set_flag [vlan-device] 0 | 1
When 1, ethernet header reorders are turned on. Dumping the device will appear as a common ethernet device without vlans. When
0(default) however, ethernet headers are not reordered, which results in vlan tagged packets when dumping the device. Usually
the default gives no problems, but some packet filtering programs might have problems with it.
set_egress_map [vlan-device] [skb-priority] [vlan-qos]
This flags that outbound packets with a particular skb-priority should be tagged with the particular vlan priority vlan-qos.
The default vlan priority is 0.
set_ingress_map [vlan-device] [skb-priority] [vlan-qos]
This flags that inbound packets with the particular vlan priority vlan-qos should be queued with a particular skb-priority. The
default skb-priority is 0.
set_name_type VLAN_PLUS_VID | VLAN_PLUS_VID_NO_PAD | DEV_PLUS_VID | DEV_PLUS_VID_NO_PAD
Sets the way vlan-device names are created. Use vconfig without arguments to see the different formats.
NOTES VLAN will use Broadcom’s NICE interface when the network device supports it. This is necessary, since usually the hardware of
these devices already removes the vlan tag from the ethernet packet. The set_flag option on vlan-devices created on such a
physical network device will be ignored. Dumping the network-device will show only untagged(non-vlan) traffic, and dumping the
vlan-devices will only show traffic intended for that vlan, without the tags.
FILES
/proc/net/vlan/config
/proc/net/vlan/[vlan-device]
SEE ALSO
ip(8), ifconfig(8)
AUTHORS
This manual page was written by Ard van Breemen <ard@kwaak.net>
The vlan patch is written by Ben Greear <greearb@candelatech.com>
VCONFIG(8)
(END)
0 0
- linux VLAN配置(vconfig)
- linux VLAN配置(vconfig)
- linux VLAN配置(vconfig)
- linux VLAN配置(vconfig)
- linux VLAN配置(vconfig)
- 用linux vconfig配置neutron VLAN试验
- centos VLAN配置(vconfig)
- linux 下VLAN数据包格式及vconfig命令测试
- linux 下VLAN数据包格式及vconfig命令测试
- vconfig - Linux 下的 802.1q 实现配置工具
- linux vlan 配置
- linux vlan 配置
- 在Linux配置VLAN Trunk
- Linux下如何配置Vlan
- linux下的super-vlan配置
- Linux配置8021.q vlan实践篇
- Linux下配置vlan网卡教程
- Linux网络接口和VLAN配置
- xenserver使用cli进行主机池添加
- C Primer Plus6-12
- maven 入门
- C语言 数组
- 【React Native开发】React Native移植原生Android项目(4)
- linux VLAN配置(vconfig)
- Android JSON解析库的使用
- C Primer Plus6-13
- 实现图片和绝对布局的自适应
- 控制硬加速 hardwareAccelerated 3.0才有
- C Primer Plus6-14
- 2--mysql学习笔记
- vb sendmessage 详解
- angular 之表单验证