NETGEAR基础

介绍

技术 特性 适用场景 说明
NETGEAR - 5端口
- 千兆
- Instant Mesh
- 无线多路由
- 旗舰级路由器 - 中文官网
- 英文官网
- 技术支持

配置

刷OpenWRTF

1
2
3
4
5
$ brew install tftp
$ tftp 192.168.1.1
tftp> put openwrt-18.06.1-ipq806.x-netgear_r7800-squashfs-factory.img
Send 8257665 bytes in 1.9 seconds
tftp>

修改LAN IP

ssh进入,然后输入

1
2
3
uci set network.lan.ipaddr=192.168.99.1
uci commit
service network restart

添加HOST

1
2
3
4
5
$ vim /etc/hosts
##### 添加如下内容 #####
192.168.99.1 r.cc
##### 内容结束 #####
$ service network restart

LUCI中文界面配置

1
2
$ opkg update
$ opkg install luci-i18n-base-zh-cn

配置系统运行日志

1
2
3
$ opkg install rsyslog
$ /etc/init.d/rsyslog enable
$ /etc/init.d/rsyslog start

配置V2Ray客户端

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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
##### 电脑操作 #####
# 下载 arm 版本的 V2Ray 客户端
$ wget https://github.com/v2ray/v2ray-core/releases/download/v4.20.0/v2ray-linux-arm.zip
$ unzip v2ray-linux-arm.zip
$ cd v2ray-linux-arm
$ scp -r v2ray-linux-arm root@192.168.99.1:/root/v2ray

##### ssh 到路由器上进行操作 #####
$ cd /root/v2ray
$ chmod +x v2ray v2ctl
$ mkdir /usr/bin/v2ray
$ mv v2ray v2ctl geoip.dat geosite.dat /usr/bin/v2ray/
$ touch /etc/v2ray/config.json
$ vim /etc/v2ray/config.json
##### 增加如下内容 #####
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"outbound": {
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "x.x.x.x",
"port": 29001,
"users": [
{
"id": "xxx-xxx-xxx-xx-xxx",
"level": 1,
"alterId": 64
}
]
}
]
},
"streamSettings": {
"network": "kcp"
},
"mux": {
"enabled": true
}
},
"outboundDetour": [
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
}
],
"inbound": {
"protocol": "dokodemo-door",
"port": 5353,
"settings": {
"address": "119.29.29.29",
"port": 53,
"network": "udp",
"timeout": 0,
"followRedirect": false
}
},
"inboundDetour": [
{
"domainOverride": [
"http",
"tls"
],
"protocol": "dokodemo-door",
"port": 1060,
"settings": {
"network": "tcp",
"timeout": 30,
"followRedirect": true
}
},
{
"protocol": "socks",
"port": 8080,
"settings": {
"auth": "noauth",
"udp": false,
"ip": "127.0.0.1"
}
}
],
"dns": {
"servers": [
"119.29.29.29",
"localhost",
"8.8.8.8",
"8.8.4.4"
]
},
"routing": {
"strategy": "rules",
"settings": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"domain": [
"geosite:cn"
],
"outboundTag": "direct"
},
{
"type": "field",
"domain": [
"google",
"facebook",
"youtube",
"twitter",
"instagram",
"gmail",
"domain:twimg.com",
"domain:t.co"
],
"outboundTag": "proxy"
},
{
"type": "field",
"ip": [
"8.8.8.8/32",
"8.8.4.4/32",
"91.108.56.0/22",
"91.108.4.0/22",
"109.239.140.0/24",
"149.154.164.0/22",
"91.108.56.0/23",
"67.198.55.0/24",
"149.154.168.0/22",
"149.154.172.0/22"
],
"outboundTag": "proxy"
},
{
"type": "field",
"port": "1-52",
"outboundTag": "direct"
},
{
"type": "field",
"port": "54-79",
"outboundTag": "direct"
},
{
"type": "field",
"port": "81-442",
"outboundTag": "direct"
},
{
"type": "field",
"port": "444-3999",
"outboundTag": "direct"
},
{
"type": "field",
"port": "4001-65535",
"outboundTag": "direct"
},
{
"domain": [
"vultr.com"
],
"type": "field",
"outboundTag": "direct"
},
{
"type": "chinasites",
"outboundTag": "direct"
},
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "direct"
},
{
"type": "chinaip",
"outboundTag": "direct"
}
]
}
},
"transport": {
"tcpSettings": {
"connectionReuse": true
},
"kcpSettings": {
"mtu": 1350,
"tti": 50,
"uplinkCapacity": 100,
"downlinkCapacity": 200,
"congestion": true,
"readBufferSize": 2,
"writeBufferSize": 2,
"header": {
"type": "wechat-video"
}
}
}
}
##### 内容结束 #####

# 检查配置文件是否有效
$ /usr/bin/v2ray/v2ray -test -config /etc/v2ray/config.json

# 配置开机启动
$ vim /etc/init.d/v2ray
##### 增加如下内容 #####
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2017 Ian Li <OpenSource@ianli.xyz>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#

START=90

USE_PROCD=1

start_service() {
mkdir /var/log/v2ray > /dev/null 2>&1
procd_open_instance
procd_set_param respawn
procd_set_param command /usr/bin/v2ray/v2ray -config /etc/v2ray/config.json
procd_set_param file /etc/v2ray/config.json
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param pidfile /var/run/v2ray.pid
procd_close_instance
}
##### 内容结束 #####
$ chmod +x /etc/init.d/v2ray
$ /etc/init.d/v2ray enable
$ service v2ray start
$ ps | grep v2ray

# 配置防火墙转发
$ vim /etc/firewall.user
##### 增加如下内容 #####
iptables -t nat -N V2RAY
iptables -t nat -A V2RAY -d x.x.x.x -j RETURN
iptables -t nat -A V2RAY -d 0.0.0.0/8 -j RETURN
iptables -t nat -A V2RAY -d 10.0.0.0/8 -j RETURN
iptables -t nat -A V2RAY -d 127.0.0.0/8 -j RETURN
iptables -t nat -A V2RAY -d 169.254.0.0/16 -j RETURN
iptables -t nat -A V2RAY -d 172.16.0.0/12 -j RETURN
iptables -t nat -A V2RAY -d 192.168.0.0/16 -j RETURN
iptables -t nat -A V2RAY -d 224.0.0.0/4 -j RETURN
iptables -t nat -A V2RAY -d 240.0.0.0/4 -j RETURN
iptables -t nat -A V2RAY -p tcp -j REDIRECT --to-ports 1060
iptables -t nat -A PREROUTING -p tcp -j V2RAY
##### 内容结束 #####
$ service firewall restart

注意:x.x.x.x 为 VPS 的IP。

优化DNS解析,防止DNS污染

1
2
3
4
5
6
7
8
9
10
11
12
$ opkg install dnsmasq
# [下载](https://coding.net/u/jacksgong/p/dns-accelerate/git/archive/master) dns-accelerate-master文件
# 将 dnsmasq.d 放入 /etc/ 中
$ vim /etc/dnsmasq.conf
##### 增加如下内容 #####
listen-address=127.0.0.1
listen-address=192.168.99.1
cache-size=102400
conf-dir=/etc/dnsmasq.d
##### 内容结束 #####

$ service dnsmasq restart
坚持原创技术分享,您的支持将鼓励我继续创作!
0%