archlinux + kde 怎么实现双网卡上网,有线走内网, wifi 走外网 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
falser101
V2EX    Linux

archlinux + kde 怎么实现双网卡上网,有线走内网, wifi 走外网

  •  
  • falser101 2024-07-09 11:38:53 +08:00 2051 次点击
    这是一个创建于 509 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如题,有无大佬讲解下

    10 条回复    2024-07-18 23:56:38 +08:00
    crownor
        1
    crownor  
       2024-07-09 11:44:24 +08:00
    修改一下对应的路由表就好了,具体的可以去查一下,指定网断走有线,然后默认走 Wi-Fi
    chisoo
        2
    chisoo  
       2024-07-09 11:45:21 +08:00
    0.0.0.0 路由指向 wifi 网关 内网段指向有线网关
    azarasi
        3
    azarasi  
       2024-07-09 12:01:34 +08:00
    需要 xtables 的 geoip 模块
    param
        4
    param  
       2024-07-09 12:28:36 +08:00 via Android
    改路由表
    falser101
        5
    falser101  
    OP
       2024-07-09 13:37:27 +08:00
    $ 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 10 0 0 wlan0
    0.0.0.0 192.168.22.1 0.0.0.0 UG 100 0 0 enp3s0
    172.16.6.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8
    192.168.1.0 0.0.0.0 255.255.255.0 U 10 0 0 wlan0
    192.168.22.0 0.0.0.0 255.255.255.0 U 100 0 0 enp3s0

    这是我的路由表,是需要删除掉有线的 0.0.0.0 这一条吗
    elechi
        6
    elechi  
       2024-07-09 14:06:08 +08:00
    默认外网都走 wifi 吧?只需要把走有线的内网网段加到路由表里就行
    norkki
        7
    norkki  
       2024-07-09 14:06:29 +08:00
    @falser101 可以不用删除 优先级比第 2 条高
    dford
        8
    dford  
       2024-07-09 14:27:57 +08:00
    falser101
        9
    falser101  
    OP
       2024-07-09 16:38:37 +08:00
    加了一条解决了
    当前路由
    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 10 0 0 wlan0
    0.0.0.0 192.168.22.1 0.0.0.0 UG 100 0 0 enp3s0
    10.0.0.0 192.168.22.1 255.0.0.0 UG 0 0 0 enp3s0
    172.16.6.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8
    192.168.1.0 0.0.0.0 255.255.255.0 U 10 0 0 wlan0
    192.168.22.0 0.0.0.0 255.255.255.0 U 100 0 0 enp3s0
    192.168.61.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1
    192.168.192.0 0.0.0.0 255.255.255.0 U 0 0 0 ztjlh3ajee
    Paulownia
        10
    Paulownia  
       2024-07-18 23:56:38 +08:00
    内网配置静态路由,公网通过网关出去
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2405 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 22ms UTC 05:42 PVG 13:42 LAX 21:42 JFK 00:42
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86