openwrt下两路由桥接

来源:互联网 发布:淘宝运动意外险是什么 编辑:程序博客网 时间:2024/04/29 04:32

两台路由:tp-link , rg100aa

rg100aa刷了openwrt, 通过rg100aa桥接访问互联网。

试了上百遍,发现wan不能设置静态ip,要设置成dhcp, 原因还是没有搞清楚。

配置如下:

tp-link: 192.168.1.1

rg100aa: 

LAN:192.168.2.1 

WAN:DHCP


配置文件:

/etc/config/network

config 'switch' 'eth1'
option 'reset' '1'
option 'enable_vlan' '1'


config 'switch_vlan'
option 'device' 'eth1'
option 'vlan' '0'
option 'ports' '0 1 2 5*'


config 'switch_vlan'
option 'device' 'eth1'
option 'vlan' '1'
option 'ports' '3 5*'


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 'type' 'bridge'
option 'ifname' 'eth1.0'
option 'proto' 'static'
option 'netmask' '255.255.255.0'
option 'nat' '1'
option 'ipaddr' '192.168.2.1'
option 'defaultroute' '0'
option 'peerdns' '0'


config 'interface' 'wan'
option 'ifname' 'eth1.1'
option 'proto' 'dhcp'


/etc/config/wireless



config 'wifi-device' 'radio0'
option 'type' 'mac80211'
option 'macaddr' '00:1f:a3:1a:3e:e0'
option 'hwmode' '11g'
option 'disabled' '0'
option 'channel' '10'
option 'txpower' '20'


config 'wifi-iface'
option 'device' 'radio0'
option 'ssid' 'net'
option 'network' 'wan'
option 'mode' 'sta'
option 'encryption' 'psk'
option 'key' '0000000000'




原创粉丝点击