linux中vlanless怎么开

linux中vlanless怎么开,第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命令

环境非常简单:一台linux(RedHat as3)的机器(kernel 2.4.21)

公网eth0

私网eth1

以前私网是接的192.168.10网段的,vlan id为10

现在想把私网在保留原来10网段的同时,还想加一个192.168.240网段,vlan id为240

其实这个题目的答案非常简单

就是用vconfig嘛

vconfig add eth1 10

vconfig add eth1 240

然后再ifconfig eth1.10配ip,ifconfig eth1.240配ip地址,用vconfig大家应该都差不多能解决这个问题。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/8228039.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-14
下一篇2023-04-14

发表评论

登录后才能评论

评论列表(0条)

    保存