Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
falser101
V2EX  ›  Linux

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

  •  
  •   falser101 · Jul 9, 2024 · 3060 views
    This topic created in 848 days ago, the information mentioned may be changed or developed.

    如题,有无大佬讲解下

    10 replies  •  2024-07-18 23:56:38 +08:00
    crownor
    crownor
    Jul 9, 2024
    1
    修改一下对应的路由表就好了,具体的可以去查一下,指定网断走有线,然后默认走 Wi-Fi
    chisoo
    chisoo
    Jul 9, 2024
    2
    0.0.0.0 路由指向 wifi 网关 内网段指向有线网关
    azarasi
    azarasi
    Jul 9, 2024
    3
    需要 xtables 的 geoip 模块
    param
    param
    Jul 9, 2024 via Android
    4
    改路由表
    falser101
    falser101
    OP
    Jul 9, 2024
    5
    $ 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
    elechi
    Jul 9, 2024
    6
    默认外网都走 wifi 吧?只需要把走有线的内网网段加到路由表里就行
    norkki
    norkki
    Jul 9, 2024
    7
    @falser101 可以不用删除 优先级比第 2 条高
    falser101
    falser101
    OP
    Jul 9, 2024
    9
    加了一条解决了
    当前路由
    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
    Paulownia
    Jul 18, 2024
    10
    内网配置静态路由,公网通过网关出去
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2969 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 10:47 · PVG 18:47 · LAX 02:47 · JFK 05:47
    ♥ Do have faith in what you're doing.