linux vlan 配置
来源:互联网 发布:网络推广书籍 百度经验 编辑:程序博客网 时间:2024/05/17 23:02
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
#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
0 0
- linux VLAN配置(vconfig)
- linux VLAN配置(vconfig)
- linux vlan 配置
- linux vlan 配置
- linux VLAN配置(vconfig)
- linux VLAN配置(vconfig)
- linux VLAN配置(vconfig)
- 在Linux配置VLAN Trunk
- Linux下如何配置Vlan
- linux下的super-vlan配置
- Linux配置8021.q vlan实践篇
- Linux下配置vlan网卡教程
- 用linux vconfig配置neutron VLAN试验
- Linux网络接口和VLAN配置
- 配置vlan
- VLAN配置
- VLAN配置
- 配置VLAN
- 【ViewPager+Fragment】ViewPager中切换界面Fragment被烧毁的题目解析
- nova-docker安装使用中遇到的一些问题(juno版)
- diff: /../Podfile.lock: No such file or directory diff: /Manifest.lock: No such file or directory er
- Code[vs]3388 三个数的排序 ( cmp+cmp1 )
- 折线分割平面
- linux vlan 配置
- 一次刨根问底的socket收包过程(Linux)
- 深入理解Android(07)——深入理解SystemServer
- Linux内核学习经验总结
- 系统菜单树生成速度优化
- 困扰无线水气表抄表的功耗问题浅谈
- merge into 语句的使用
- Monkey and Banana
- devstack安装错误一个“No module named MySQLdb”