本帖最後由 角色 於 2013-3-3 14:15 編輯
引言——由于公司需要,把两边的segment的printer尽可能连接起来。而两家公司都是独立上网。所以需要用一个router。因为我知道OpenWRT能做VLAN和routing。但是。。。。。。。。。。。。OpenWRT本身的defualt firmware好像有bugs。
- config 'interface' 'loopback'
- option 'ifname' 'lo'
- option 'proto' 'static'
- option 'ipaddr' '127.0.0.1'
- option 'netmask' '255.0.0.0'
- config 'interface' 'lan'
- option 'ifname' 'eth0.1'
- option 'type' 'bridge'
- option 'proto' 'static'
- option 'netmask' '255.255.255.0'
- option 'ipaddr' '192.168.10.1'
- config 'interface' 'wan'
- option 'ifname' 'eth0.2'
- option 'proto' 'dhcp'
- config 'switch'
- option 'name' 'rtl8366rb'
- option 'reset' '1'
- option 'enable_vlan' '1'
- option 'enable_vlan4k' '1'
- config 'switch_vlan'
- option 'device' 'rtl8366rb'
- option 'vlan' '1'
- option 'ports' '3 4 5t'
- config 'switch_vlan'
- option 'device' 'rtl8366rb'
- option 'vlan' '2'
- option 'ports' '0 5t'
- config 'switch_vlan'
- option 'device' 'rtl8366rb'
- option 'vlan' '3'
- option 'ports' '1 2 5t'
- config 'interface' 'lan2'
- option 'type' 'bridge'
- option 'proto' 'static'
- option 'ifname' 'eth0.3'
- option 'ipaddr' '192.168.30.1'
- option 'netmask' '255.255.255.0'
- config 'route'
- option 'interface' 'lan'
- option 'target' '192.168.30.0'
- option 'netmask' '255.255.255.0'
- option 'gateway' '192.168.30.1'
- config 'route'
- option 'interface' 'lan2'
- option 'target' '192.168.10.0'
- option 'netmask' '255.255.255.0'
- option 'gateway' '192.168.10.1'
複製代碼 #
但是进入router里面,打route,竟然没有我added的static routes!!! - root@OpenWrt:/etc/config# route
- Kernel IP routing table
- Destination Gateway Genmask Flags Metric Ref Use Iface
- 192.168.30.0 * 255.255.255.0 U 0 0 0 br-lan2
- 192.168.10.0 * 255.255.255.0 U 0 0 0 br-lan
- 10.0.88.0 * 255.255.255.0 U 0 0 0 eth0.2
- default 10.0.88.1 0.0.0.0 UG 0 0 0 eth0.2
- root@OpenWrt:/etc/config#
複製代碼 #
那么先用手动add static route看看
1. 先add ip packages (我用GUI加入,非常简单)
ip (一件叫iproute2)
【1】wiki http://en.wikipedia.org/wiki/Iproute2
【2】Linux Advanced Routing & Traffic Control HOWTO Link
【3】IPROUTE2 Utility Suite Howto Link |