標題: Configuration of transparent V2Ray proxy server using Raspberry Pi —— Watch YouTube and CCTV5 Simultaneously [打印本頁] 作者: 角色 時間: 2019-2-20 13:40 標題: Configuration of transparent V2Ray proxy server using Raspberry Pi —— Watch YouTube and CCTV5 Simultaneously
本帖最後由 角色 於 2019-2-21 00:20 編輯
I have written three posts about the configuration methods of transparent (web) server used in mainland China[1,2,3]. In the previous configurations, the remote free websites could be accessed such as Facebook, YouTube, etc. However there were problems in accessing the local mainland websites. The main cause of the problems are due to the poor design of routing rules used, which will be described later. The network configuration of this post is:
[attach]4290[/attach]
The right-hand-side is HK or other free-world ISP sites. An ordinary V2Ray node (server) is installed which will be used for letting the remote V2ray node (client) installed in mainland China. The left-hand-side is the network used in mainland China. In general we got the internet access via the local mainland China ISP. An ordinary WiFi router is installed at home/in office.
The configuration of V2ray node (server) is a general one which can be easily realised by general methods.
The configuration of V2ray node (client) is more complex and will be shown later. The IP address of the V2ray node (client) is 192.168.4.22. The gateway and nameserver are the same, i.e., 192.168.4.1.
The router 2 used in mainland China has to be configured as follows:
1. Router (WAN) IP is obtained via DHCP client method (got ISP gateway and ISP DNS server IPs)
2. Router (LAN) IP is 192.168.4.1
2. Router (LAN DHCP server):
- IP address distribution range: 192.168.4.100-192.168.4.200
- Gateway: 192.168.4.22
- DNS server: 192.168.4.22
PC and mobile device obtained IPs, gateway, dns server from the router 2 via DHCP method.
iptables -t mangle -A PREROUTING -p udp -j V2RAY_MARK
#iptables -t mangle -A OUTPUT -j V2RAY_MARK
複製代碼
.
The output chain rules used line 23 and 47 are used for local access within the v2Ray machine. Since we do not plan to access the website locally, then they are commented out.作者: 角色 時間: 2019-2-20 14:22
The reason of not able to access the local sites such as CCTV5 is due to the routing section. We need to separate the "domain" and "ip".
Previous routing configuration
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [{
"type": "field",
"domain": ["geosite:cn"],
"ip": ["geoip:private"],
"ip": ["geoip:cn"],
"outboundTag": "direct"
}]
}
複製代碼
Present routing configuration
{
"type": "field",
"outboundTag": "direct",
"domain": [ "geosite:cn" ]
},
{
"type": "field",
"ip": ["geoip:private"],
"ip": ["geoip:cn"],
"outboundTag": "direct"
}
複製代碼
作者: 角色 時間: 2019-2-20 17:35
本帖最後由 角色 於 2019-2-21 12:13 編輯
Test results:
Able to see YouTube and CCTV5 at the same time on pc, mobile phone and iPad without any vpn/proxy client installed in devices. The performance is very satisfactory.
Please note that the DNS provided by the V2ray is very intelligent, it means for local IP, it will goes locally 114.114.114.114. Otherwise it will go to the remote site 8.8.8.8 via the vmess tunnel.