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

Linux 添加路由的问题

  •  
  •   commoccoom · Aug 5, 2016 · 2929 views
    This topic created in 3645 days ago, the information mentioned may be changed or developed.
    在 Linux 下添加一体静态路由 192.168.0.0/24 ,下一跳指向 192.168.0.1 的命令是?
    我在网上看到都是 route 命令添加一条路由,那下一跳怎么指定呢?
    有没有相关的资料看看,我 google 了好久没搜到。谢谢!
    Supplement 1  ·  Aug 7, 2016
    找到了,感谢给位。
    3 replies    2016-08-05 16:30:13 +08:00
    Ellison
        1
    Ellison  
       Aug 5, 2016   ❤️ 1
    man route
    redsonic
        2
    redsonic  
       Aug 5, 2016   ❤️ 1
    route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1

    or

    ip route add 192.168.0.0/24 via 192.168.0.1
    jimzhong
        3
    jimzhong  
       Aug 5, 2016   ❤️ 1
    ip route 192.168.0.0/24 via 192.168.0.1 dev {name of the interface}
    route 应该已经过时了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3561 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 04:35 · PVG 12:35 · LAX 21:35 · JFK 00:35
    ♥ Do have faith in what you're doing.