OpenWrt WiFi Repeater

因为无线网络中途停止服务, 请通过有线网络连接路由器.

WAN口连接另外一台无线路由器, 若让其WAN口暂时ACCEPT连接, 就可以通过WAN口操作了.

Backup Config Files

# ssh root@192.168.31.1
$ mkdir ~/config/
$ cp /etc/config/network ~/config/
$ cp /etc/config/wireless ~/config/

Config via Luci

  • Network ▷ Wireless ▷ Remove
  • Network ▷ Wireless ▷ Scan ▷ Join Network (wwan)
  • Network ▷ Wireless ▷ Add (MiWiFi/AccessPoint/lan)
  • Save & Apply

/etc/config/network (old)

config interface 'loopback'  
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config globals 'globals'  
    option ula_prefix 'fd8d:3e58:640f::/48'

config interface 'lan'  
    option type 'bridge'
    option ifname 'eth0.1'
    option proto 'static'
    option netmask '255.255.255.0'
    option ip6assign '60'
    option ipaddr '192.168.31.1'

config device 'lan_dev'  
    option name 'eth0.1'
    option macaddr '6e:70:cb:99:5e:a5'

config interface 'wan'  
    option ifname 'eth0.2'
    option proto 'dhcp'

config device 'wan_dev'  
    option name 'eth0.2'
    option macaddr '6e:70:cb:99:5e:a6'

config interface 'wan6'  
    option ifname 'eth0.2'
    option proto 'dhcpv6'

config switch  
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan  
    option device 'switch0'
    option vlan '1'
    option ports '0 1 2 3 6t'

config switch_vlan  
    option device 'switch0'
    option vlan '2'
    option ports '4 6t'

/etc/config/network (new)

# ...

config interface 'wwan'  
    option proto 'dhcp'

新增了最后2行

/etc/config/wireless (old)

config wifi-device 'radio0'  
    option type 'mac80211'
    option channel '11'
    option hwmode '11g'
    option path 'platform/10300000.wmac'
    option htmode 'HT20'
    option disabled '0'

config wifi-iface  
    option device 'radio0'
    option network 'lan'
    option mode 'ap'
    option encryption 'none'
    option ssid 'MiWiFi'

/etc/config/wireless (new)

# ...

config wifi-iface  
    option ssid 'aWiFi'
    option encryption 'none'
    option device 'radio0'
    option mode 'sta'
    option network 'wwan'
    option bssid '00:24:6C:14:35:51'

# ...

新增了中间7行

Issues

  • 两端仍处在不同的网络, 不是严格意义的中继.

Read More