Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, im a newbie and i have a question: On the Linux, using the ip command, how do you add a static route to subnet 192.168.0.0/16 using next-hop 10.10.0.1? best ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2013
    Posts
    1

    add static route with ip command


    Hi, im a newbie and i have a question:

    On the Linux, using the ip command, how do you add a static route to subnet 192.168.0.0/16 using next-hop 10.10.0.1?

    best regards
    /Mattias

  2. #2
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    636
    you use the "route" command:
    Code:
    route add -net 192.168.0.0/16 gw 10.10.0.1 eth0
    of course your network device may be different than "eth0" (mine is br0).

  3. #3
    Linux Newbie
    Join Date
    Jan 2013
    Posts
    116
    ip route add 192.168.0.0/16 dev eth0

    ip route add default via 192.168.0.254

    Hope above examples help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •