学校的内网比较大,宿舍是10.40.0.0/16,实验室是10.32.0.0/16,想在实验室用宿舍的电脑打VR就有点麻烦了,又懒得把电脑搬到实验室(搬过去晚上的osu时间就没了,才不干),所以开始折腾下这个
之前的想法是让宿舍电脑作为OpenVPN服务器,再另外整一个路由器跑OpenVPN作为Tap桥接到内网上,这样头显就和电脑在同一个网段了
但是后面咕咕咕了就没继续整,而且好像有别的方案,接下来准备试试WG
然后618 1500收了个二手的Quest2,为了快乐的玩耍只能尽快整出来了
Updated on 6/8
发现了gretap这玩意儿,感觉有戏
Updated on 6/10
搞定了,性能还行,过段时间去试试
边缘端
config device option type 'bridge' option name 'br-vr' option macaddr '00:E0:4C:68:64:12' list ports 'eth2' option mtu6 '1280' option mtu '1462' config interface 'tunnel' option proto 'gretap' option peeraddr '10.0.1.1' option ipaddr '10.0.1.147' option network 'RELAN' option mtu '1462' config interface 'RELAN' option proto 'static' option device 'br-vr' option ipaddr '10.0.1.199'
master端
config interface 'tunnel' option proto 'gretap' option peeraddr '10.0.1.147' option ipaddr '10.0.1.1' option network 'lan' option mtu '1462'
要注意的就是mtu网桥和设备都要匹配,并且全部接口网桥都要加入LAN的防火墙组,不然流量会转发不了
iperf3数据
▶ iperf3 -c 10.0.1.1 Connecting to host 10.0.1.1, port 5201 [ 5] local 10.0.1.217 port 57704 connected to 10.0.1.1 port 5201 [ ID] Interval Transfer Bitrate [ 5] 0.00-1.00 sec 60.1 MBytes 504 Mbits/sec [ 5] 1.00-2.00 sec 57.6 MBytes 483 Mbits/sec [ 5] 2.00-3.00 sec 56.0 MBytes 470 Mbits/sec [ 5] 3.00-4.00 sec 58.6 MBytes 492 Mbits/sec [ 5] 4.00-5.00 sec 56.8 MBytes 477 Mbits/sec [ 5] 5.00-6.00 sec 55.7 MBytes 467 Mbits/sec [ 5] 6.00-7.00 sec 60.1 MBytes 504 Mbits/sec [ 5] 7.00-8.00 sec 58.3 MBytes 489 Mbits/sec [ 5] 8.00-9.00 sec 58.1 MBytes 487 Mbits/sec [ 5] 9.00-10.00 sec 58.0 MBytes 486 Mbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate [ 5] 0.00-10.00 sec 579 MBytes 486 Mbits/sec sender [ 5] 0.00-10.01 sec 577 MBytes 483 Mbits/sec receiver iperf Done. ▶ iperf3 -c 10.0.1.1 -R Connecting to host 10.0.1.1, port 5201 Reverse mode, remote host 10.0.1.1 is sending [ 5] local 10.0.1.217 port 57722 connected to 10.0.1.1 port 5201 [ ID] Interval Transfer Bitrate [ 5] 0.00-1.00 sec 98.0 MBytes 822 Mbits/sec [ 5] 1.00-2.00 sec 96.8 MBytes 812 Mbits/sec [ 5] 2.00-3.00 sec 100 MBytes 839 Mbits/sec [ 5] 3.00-4.00 sec 95.1 MBytes 798 Mbits/sec [ 5] 4.00-5.00 sec 95.8 MBytes 804 Mbits/sec [ 5] 5.00-6.00 sec 105 MBytes 879 Mbits/sec [ 5] 6.00-7.00 sec 94.2 MBytes 791 Mbits/sec [ 5] 7.00-8.00 sec 101 MBytes 848 Mbits/sec [ 5] 8.00-9.00 sec 94.9 MBytes 796 Mbits/sec [ 5] 9.00-10.00 sec 101 MBytes 846 Mbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 984 MBytes 826 Mbits/sec 0 sender [ 5] 0.00-10.00 sec 982 MBytes 823 Mbits/sec receiver iperf Done. ▶ iperf3 -c 10.0.1.1 -R -u -b 200M Connecting to host 10.0.1.1, port 5201 Reverse mode, remote host 10.0.1.1 is sending [ 5] local 10.0.1.217 port 58681 connected to 10.0.1.1 port 5201 [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-1.00 sec 23.8 MBytes 200 Mbits/sec 0.033 ms 0/18217 (0%) [ 5] 1.00-2.00 sec 23.8 MBytes 200 Mbits/sec 0.135 ms 0/18201 (0%) [ 5] 2.00-3.00 sec 23.9 MBytes 200 Mbits/sec 0.027 ms 0/18240 (0%) [ 5] 3.00-4.00 sec 23.8 MBytes 200 Mbits/sec 0.032 ms 0/18223 (0%) [ 5] 4.00-5.00 sec 23.8 MBytes 200 Mbits/sec 0.050 ms 0/18220 (0%) [ 5] 5.00-6.00 sec 23.8 MBytes 200 Mbits/sec 0.048 ms 0/18220 (0%) [ 5] 6.00-7.00 sec 23.8 MBytes 200 Mbits/sec 0.024 ms 0/18227 (0%) [ 5] 7.00-8.00 sec 23.8 MBytes 200 Mbits/sec 0.058 ms 0/18217 (0%) [ 5] 8.00-9.00 sec 23.8 MBytes 200 Mbits/sec 0.059 ms 0/18203 (0%) [ 5] 9.00-10.00 sec 23.9 MBytes 200 Mbits/sec 0.053 ms 0/18244 (0%) - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-10.00 sec 238 MBytes 200 Mbits/sec 0.000 ms 0/182233 (0%) sender [ 5] 0.00-10.00 sec 238 MBytes 200 Mbits/sec 0.053 ms 0/182212 (0%) receiver iperf Done. ▶ iperf3 -c 10.0.1.1 -R -u -b 400M Connecting to host 10.0.1.1, port 5201 Reverse mode, remote host 10.0.1.1 is sending [ 5] local 10.0.1.217 port 52226 connected to 10.0.1.1 port 5201 [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-1.00 sec 47.7 MBytes 400 Mbits/sec 0.019 ms 0/36446 (0%) [ 5] 1.00-2.00 sec 47.7 MBytes 400 Mbits/sec 0.038 ms 0/36428 (0%) [ 5] 2.00-3.00 sec 47.7 MBytes 400 Mbits/sec 0.028 ms 0/36452 (0%) [ 5] 3.00-4.00 sec 47.7 MBytes 400 Mbits/sec 0.028 ms 0/36435 (0%) [ 5] 4.00-5.00 sec 47.7 MBytes 400 Mbits/sec 0.036 ms 0/36445 (0%) [ 5] 5.00-6.00 sec 47.7 MBytes 400 Mbits/sec 0.030 ms 0/36456 (0%) [ 5] 6.00-7.00 sec 47.7 MBytes 400 Mbits/sec 0.017 ms 0/36446 (0%) [ 5] 7.00-8.00 sec 47.7 MBytes 400 Mbits/sec 0.026 ms 0/36447 (0%) [ 5] 8.00-9.00 sec 47.7 MBytes 400 Mbits/sec 0.028 ms 0/36418 (0%) [ 5] 9.00-10.00 sec 47.7 MBytes 400 Mbits/sec 0.025 ms 0/36457 (0%) - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-10.00 sec 477 MBytes 400 Mbits/sec 0.000 ms 0/364467 (0%) sender [ 5] 0.00-10.00 sec 477 MBytes 400 Mbits/sec 0.025 ms 0/364430 (0%) receiver iperf Done. ▶ iperf3 -c 10.0.1.1 -u -b 400M Connecting to host 10.0.1.1, port 5201 [ 5] local 10.0.1.217 port 60283 connected to 10.0.1.1 port 5201 [ ID] Interval Transfer Bitrate Total Datagrams [ 5] 0.00-1.00 sec 47.6 MBytes 399 Mbits/sec 36388 [ 5] 1.00-2.00 sec 47.8 MBytes 401 Mbits/sec 36497 [ 5] 2.00-3.00 sec 47.7 MBytes 400 Mbits/sec 36423 [ 5] 3.00-4.00 sec 47.7 MBytes 400 Mbits/sec 36463 [ 5] 4.00-5.00 sec 47.7 MBytes 400 Mbits/sec 36434 [ 5] 5.00-6.00 sec 47.7 MBytes 400 Mbits/sec 36441 [ 5] 6.00-7.00 sec 47.7 MBytes 400 Mbits/sec 36435 [ 5] 7.00-8.00 sec 47.7 MBytes 400 Mbits/sec 36439 [ 5] 8.00-9.00 sec 47.6 MBytes 399 Mbits/sec 36402 [ 5] 9.00-10.00 sec 47.7 MBytes 401 Mbits/sec 36474 - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-10.00 sec 477 MBytes 400 Mbits/sec 0.000 ms 0/364396 (0%) sender [ 5] 0.00-10.00 sec 477 MBytes 400 Mbits/sec 0.012 ms 207/364396 (0.057%) receiver iperf Done.
这上面的测试都是连的桥接的有线口
Quest2的最大码率好像是200Mbps,所以应该问题不大
Updated on 6/12
看起来测起来都挺不错,但是实操有点问题,折腾了半天实在懒得弄了就把电脑搬到实验室去了,不过感觉可能还是mtu的问题,有机会再试试吧