[Exchange and share] 分享个通过咱们V23系统有线上公司内网,无线上外网的方法
Tofloor
poster avatar
139******54
deepin
2023-03-16 22:39
Author

公司环境只能上内网,访问内部网页,要是上外网需要切换到无线网络才可以,所以有好多人都是来回切换很不方便。
我在这里分享下可能通过终端配置route的方式让我们实现内网访问走有线网络,上外网走无线网络的方式

首先通过route -n 查看网络信息

LYW@LYW-PC:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlp0s20f3
0.0.0.0 10.10.2.254 0.0.0.0 UG 100 0 0 enp0s31f6
10.10.2.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s31f6
192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp0s20f3

通过上面信息我们能看到有线网卡enp03s1f6无线网卡wlp0s20f3
下面我们要先给有线网络添加路由,通过以下命令
route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.10.2.254 dev enp0s31f6 意思是让10.0.0.0网段上网通过10.10.2.254网关上网。
后面我们在给无线与有线网络添加上外网默认网关
sudo route add default gw 192.168.1.1 这样我们就可通过有线上内网,无线访问外网

希望可以对大家有用吧。

Reply Favorite View the author
All Replies
jiutian123
deepin
2023-03-16 22:43
#1

like

Reply View the author
fax928
Moderator
2023-03-16 23:16
#2

thanks

Reply View the author
ThinkYoung
deepin
2023-03-16 23:22
#3

kissing_heart帅!

Reply View the author
晚秋(lateautumn)
Moderator
2023-03-17 00:24
#4

高手like

Reply View the author
世界和平
deepin
2023-03-17 00:25
#5

内网上外网,那安全性不就大大降低了?

Reply View the author
滢泷迷雾
deepin
2023-03-17 00:48
#6

有没有试过再屏蔽游戏的网络环境只让手机热点实现游戏登录?

当时内网上不去游戏,但是能下载安装游戏就觉得奇怪,尝试抓包看下ip,因为全热点游戏延迟很高当时没5G

逐个目标IP测试静态路由到热点,然后还真成功了,大部分流量依然走内网,极少流量通过热点,延迟问题大幅度改善

Reply View the author