[Others] 怎样设置内外网同时使用
Tofloor
poster avatar
happyfamily666
deepin
2021-12-08 18:26
Author

目前win10、win11双网卡内外网通过设置网关实现内外网同时使用,deepin怎么设置可以也实现此功能。

Reply Favorite View the author
All Replies
liwl
deepin
2021-12-08 18:39
#1

deepin内网不要设置网关,内网网络通过添加路由来处理,终端执行nmtui,就可以编辑路由

外网不要改,默认就可以。

Reply View the author
Sun
deepin
2021-12-08 21:59
#2

我目前就使用双网卡,控制固定网段走固定的网卡就行,外网不用处理。

我写了个脚本你可以参考,wlp4s0是内网卡。

内网是固定IP,外网自动获取的IP

#!/bin/bash
# 删除 任何网段都走内网卡的路由设置
sudo route del -net 0.0.0.0 netmask 0.0.0.0 gw 10.101.176.1 dev wlp4s0
# 控制 10.101.0.0/16 IP段走 wlp4s0 网卡。下面都一样,只是控制不同网段走不同网卡。
sudo route add -net 10.101.0.0 netmask 255.255.0.0 gw 10.101.176.1 wlp4s0
sudo route add -net 10.248.0.0 netmask 255.255.0.0 gw 10.101.176.1 wlp4s0
sudo route add -net 10.54.210.0 netmask 255.255.255.0 gw 10.101.176.1 wlp4s0
sudo route add -net 10.251.0.0 netmask 255.255.0.0 gw 10.101.176.1 wlp4s0
sudo route add -net 10.254.0.0 netmask 255.255.0.0 gw 10.101.176.1 wlp4s0
sudo route add -net 10.246.0.0 netmask 255.255.0.0 gw 10.101.176.1 wlp4s0
sudo route add -net 172.24.0.0 netmask 255.255.255.0 gw 10.101.176.1 wlp4s0
sudo route add -net 10.5.0.0 netmask 255.255.0.0 gw 10.101.176.1 wlp4s0
Reply View the author
wyz144343
deepin
2022-04-11 20:53
#3

这个命令简直太帅了。

Reply View the author