openwrt下两路由桥接

本文介绍了一种使用TP-Link和RG100AA两个路由器的网络配置方案,RG100AA路由器搭载OpenWRT固件并通过桥接模式连接互联网。详细展示了配置文件,包括网络接口的静态IP设置、DHCP使用及无线网络参数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

两台路由: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'




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值