openwrt下VLAN的配置
来源:互联网 发布:什么叫绿鞋机制知乎 编辑:程序博客网 时间:2024/05/21 14:50
分类: Openwrt&路由器2014-08-21 11:38 5576人阅读 评论(1) 收藏 举报
想要改变你的路由器wan口和lan口配置或者添加wan口等就需要用到vlan配置
openwrt中的配置文件为/etc/config/network
如下将port0设置为wan口
- config switch_vlan
- option device eth0
- option vlan 0
- option ports "1 2 3 4 5*" #port1、2、3、4和cpu 5属于vlan 0
- config switch_vlan
- option device eth0
- option vlan 1
- option ports "0 5*" #port0和cpu 5属于vlan 1
- config interface lan
- option type bridge
- option ifname eth0.0 #把vlan 0配置成lan口,即port1、2、3、4都是lan口了。
- option proto static
- option ipaddr 192.168.0.168
- option netmask 255.255.255.0
- option gateway 192.168.0.1
- option dns 192.168.0.1
- option nat 1
- config interface wan
- option ifname eth0.1 #把vlan 1配置成wan口,即port0就是wan口了。
- option proto dhcp
上面的配置文件只有一个wan口
如果想要增加一个wan口,需要再增加一个config switch_vlan,如下
- config switch_vlan
- option device eth0
- option vlan 0
- option ports "1 2 3 5*" #port1、2、3和cpu 5属于vlan 0
- config switch_vlan
- option device eth0
- option vlan 1
- option ports "0 5*" #port0和cpu 5属于vlan 1
- config switch_vlan
- option device eth0
- option vlan 2
- option ports "4 5*" #port4和cpu 5属于vlan 2
- config interface wan2
- option ifname eth0.2 #把vlan 2配置成wan2口,即port4就是wan2了
- option proto dhcp
当然wan口增加了一个,lan口就要减少一个。
配置这个的方法也可以看luci页面的额配置,更加直观。
版权声明:本文为博主原创文章,未经博主允许不得转载。
0 0
- openwrt下VLAN的配置
- openwrt下VLAN的配置
- RG100-AA下OpenWRT网络VLAN配置
- 如何在OpenWRT的非交换网卡/单口网卡(OpenWRT x86)下配置802.1Q VLAN
- FreeBSD下的VLAN配置
- 我的openwrt学习笔记(三十一):openwrt 的vlan配置
- openwrt源码中修改vlan配置
- linux下的super-vlan配置
- Openwrt/Linux 添加 vlan的步骤
- openwrt VLAN的pvid/vid; tag/untag
- openwrt通过network文件配置多个VLAN
- 交换机VLAN的配置
- 交换机的VLAN配置
- 交换机VLAN的配置
- vlan配置的步骤
- private vlan 的配置
- huawei vlan的配置
- vlan的基本配置
- Chapter 3. The LWP Class Model
- 链表面试题小结
- Mongodb与Redis应用指标对比
- iOS设计模式--桥接
- xml
- openwrt下VLAN的配置
- 关于ImageLoadingProgressListener不执行的囧事儿。
- iOS xxx.pch
- java4大基本算法加密解析
- Linux 网桥配置命令:brctl
- C++的运算符重载
- GIT使用总结
- Android中实现定时器的三种方法
- XUtils中Bitmap设置的图片如何平铺满