Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 04-07-2016, 03:23 PM   #1
LQ Newbie
Registered: Aug 2010
Posts: 4

Rep: Reputation: 0
linux isue with static routing

Hello everyone,
I have this network simulated in virtualbox: network diagram

I am requested to make h1 and h2 communicate through R1.
I tried first to setup a static route on r1 (route add -host gw
I have also configured all of the ip adresses on every device.
after that static route, if i want to ping from r1 to h1 it does not work and it is trying to use the default route instead of the static route.
Can you tell me wat i have done wrong?
Thank you
Old 04-07-2016, 09:54 PM   #2
Ser Olmy
Senior Member
Registered: Jan 2012
Distribution: Slackware
Posts: 3,332

Rep: Reputation: Disabled
A specific route will always take precedence over a more general route, so the host route should certainly have been chosen over the default route (which is the most non-specific route one can have).

For the host route on R1 to work, R1 must be able to reach (R3), and R3 must not respond with an ICMP error. Can you ping from R1? Is routing enabled on R3? Are there any firewall settings on R3 that might prevent packets from being forwarded?
Old 04-08-2016, 03:51 AM   #3
LQ Newbie
Registered: Aug 2010
Posts: 4

Original Poster
Rep: Reputation: 0
I managed to make it work.
I forgot to activate ip_Forward.
Now it works.
Thank you


linux, route

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Static IP range routing on Linux fmillion Linux - Networking 5 02-21-2013 10:42 PM
Dynamic routing isn't done; static routing works for about 2 seconds for wireless gregorian Linux - Networking 7 02-19-2010 07:43 AM
Static IP Routing dojiep Linux - Networking 2 08-08-2006 08:42 AM
Static Routing in Linux suvajit Linux - Networking 4 05-16-2003 03:54 AM
Static Ip's and Routing Sarcha Linux - Networking 5 02-28-2003 09:19 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration