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

Linux 添加路由的问题

  •  
  •   commoccoom · Aug 5, 2016 · 3094 views
    This topic created in 3766 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
    Ellison
    Aug 5, 2016❤️1
    1
    man route
    redsonic
    redsonic
    Aug 5, 2016❤️1
    2
    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
    jimzhong
    Aug 5, 2016❤️1
    3
    ip route 192.168.0.0/24 via 192.168.0.1 dev {name of the interface}
    route 应该已经过时了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1239 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:35 · PVG 01:35 · LAX 09:35 · JFK 12:35
    ♥ Do have faith in what you're doing.