WNDR3700V4 with Openwrt

Install

  1. 下载 factory.img 文件
  2. 将网线连接至路由器lan口,设置电脑IP为192.168.1.2 掩码为255.255.255.0
  3. 断电, 按住reset不放, 通电, 直到电源灯由黄色闪烁到绿色闪烁,松开reset
  4. 上传.img文件, windows命令为tftp -i 192.168.1.1 put openwrt**.img, linux: tftp 192.168.1.1 -m binary -c put factory.img
  5. 等到系统正常启动之后,按电源开关断电,然后再通电(否则可能会没有5G的wifi)
  6. 网页进入192.168.1.1, 修改密码,开始ssh连接

设置上网

  1. enable pppoe
1
2
3
4
5
6
7
# vi /etc/config/network
config interface 'wan'
        option ifname 'eth1'
        option proto 'pppoe'
        option username 'ISP分配的用户名'
        option password '密码'
        option hostname 'OpenWrt'

or run cmd directly

1
2
3
uci set network.wan.proto=pppoe
uci set network.wan.username=username
uci set network.wan.password=password
  1. enable wireless (这步可以在网页上操作)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
vi /etc/config/wireless
config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11ng'
        option path 'pci0000:00/0000:00:11.0'
        option channel 'auto'
        option country '00'
        option txpower '17'
        option htmode 'HT40-'
        option noscan '1'

config wifi-iface
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option wmm '1'
        option ssid 'OpenWrt_2.4G'
        option encryption 'psk2'
        option key '无线密码'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11na'
        option path 'pci0000:00/0000:00:12.0'
        option channel '44'
        option txpower '12'
        option country '00'
        option htmode 'HT40-'
        option noscan '1'

config wifi-iface
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option wmm '1'
        option ssid 'OpenWrt_5G'
        option encryption 'psk2'
        option key '无线密码'
  1. /etc/init.d/network restart

LED config

  1. Name: WAN(green) LED Name: netgear:green:wan Trigger: netdev Device: eth0.2

  2. Name: WLAN2G LED Name: netgear:green:wlan2g Trigger: phy0tpt

  3. Name: WLAN5G LED Name: netgear:blue:wlan5g Trigger: phy1tpt

  4. 如果想灭灯,修改 Trigger 为 None

shadowsocks

  1. install shadowsocks
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# opkg update
# opkg install iptables-mod-nat-extra ipset libopenssl
# opkg remove dnsmasq && opkg install dnsmasq-full
# opkg install shadowsocks-libev-spec_x.x.x-x_ar71xx.ipk
# vi /etc/shadowsocks.json
{
      "server": "X.X.X.X",
      "server_port": "443",
      "password": "password",
      "local_port": "1080",
      "method": "rc4-md5"
}
# /etc/init.d/shadowsocks enable
# /etc/init.d/shadowsocks start
  1. config dnsmasq and ipset
1
2
3
4
5
# ipset -N gfwlist iphash
//# iptables -t nat -A PREROUTING -p tcp -m set --match-set gfwlist dst -j REDIRECT --to-port 1080
# iptables -t nat -A PREROUTING -p tcp -s 192.168.1.64/27 -j REDIRECT --to-port 1080
# echo "conf-dir=/etc/dnsmasq.d" >> /etc/dnsmasq.conf
# mkdir /etc/dnsmasq.d/
  1. download dnsmasq_list.conf to /etc/dnsmasq.d/

other config

  1. iwconfig wlan0-1 rate *M auto

Ref