Routing Problem: route is not adding to the routing table

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
bernd01
DD-WRT Novice


Joined: 08 May 2012
Posts: 5

PostPosted: Tue May 08, 2012 21:29    Post subject: Routing Problem: route is not adding to the routing table Reply with quote
Hello everybody!

Unfortunately I am a newbie to routing tables but this is what I want to achieve:

route only certain traffic through the openvpn tunnel.

after connecting to the vpn my routing table looks like this (it routes all the traffic through the tunnel)



after deleting the selected route with:
Code:
route del default gw 172.16.24.217 netmask 128.0.0.0 dev tun0

the route is gone as expected.

However, when I try to add a route for only one destination ip with:
Code:
route add -net 50.16.250.15 gw 172.16.24.217 netmask 128.0.0.0 dev tun0

the new route won't show up in the routing table.

What I don't understand is, adding the default route with this code works again:
Code:
route add default gw 172.16.24.217 netmask 128.0.0.0 dev tun0


Does anybody know, what I am doing wrong?

Your help will be really appreciated!

Thanks a lot,
Bernd
Sponsor
BasCom
DD-WRT Guru


Joined: 29 Jul 2009
Posts: 1378
Location: Germany

PostPosted: Wed May 09, 2012 11:30    Post subject: Reply with quote
you cannot use netmask 128.0.0.0 !! this is no valid netmask! try 255.255.255.255
_________________
RT-N66U @ Build 25697M K3.10.63
TL-WR842ND v1 @ BS-build 23919 WDS AP
TL-WR841ND @ BS-build 23919 WDS Client
TL-WR841ND @ BS-build 23919 Client Bridge ( Routed )
bernd01
DD-WRT Novice


Joined: 08 May 2012
Posts: 5

PostPosted: Wed May 09, 2012 11:52    Post subject: Reply with quote
Hi BasCom,

Thanks for your reply!
But why is in my routing table before deleting the default route (the bold marked row in the picture) at genmask the value 128.0.0.0?

Or does that mean, Genmask is not netmask?

Thanks a lot!

Best regards,
Bernd
BasCom
DD-WRT Guru


Joined: 29 Jul 2009
Posts: 1378
Location: Germany

PostPosted: Wed May 09, 2012 11:56    Post subject: Reply with quote
it does, but this is faulty. cant tell you why.
_________________
RT-N66U @ Build 25697M K3.10.63
TL-WR842ND v1 @ BS-build 23919 WDS AP
TL-WR841ND @ BS-build 23919 WDS Client
TL-WR841ND @ BS-build 23919 Client Bridge ( Routed )
bernd01
DD-WRT Novice


Joined: 08 May 2012
Posts: 5

PostPosted: Wed May 09, 2012 20:00    Post subject: Reply with quote
Hi,

Thanks for the info. I've tried with 255.255.255.255, also 255.255.255.0, 255.255.0.0, 255.0.0.0... no luck...

i just can add a default route...

when i add a route with "route add-net ip" it does not work...

this is really frustrating...
routvol
DD-WRT User


Joined: 02 Feb 2009
Posts: 87

PostPosted: Thu May 10, 2012 10:52    Post subject: Reply with quote
have a look at my configuration.
i did the same, kind of.

_________________
my dd-wrt configuration:
http://www.dd-wrt.com/phpBB2/viewtopic.php?p=682296
BasCom
DD-WRT Guru


Joined: 29 Jul 2009
Posts: 1378
Location: Germany

PostPosted: Thu May 10, 2012 16:18    Post subject: Reply with quote
bernd: it worked for me. you can also define routes in ovpn conf

just set "route 50.16.250.15 255.255.255.255 172.16.24.217" without ""

or try set in telnet without "dev tun0"

btw: your routing table looks very strange:
two default routes? guess there´s someting missconfigured.Strange netmasks and strange route to 128.0.0.0 Very Happy

_________________
RT-N66U @ Build 25697M K3.10.63
TL-WR842ND v1 @ BS-build 23919 WDS AP
TL-WR841ND @ BS-build 23919 WDS Client
TL-WR841ND @ BS-build 23919 Client Bridge ( Routed )
bernd01
DD-WRT Novice


Joined: 08 May 2012
Posts: 5

PostPosted: Tue May 15, 2012 18:37    Post subject: Reply with quote
I finally got it to work!!

1.) i have to use the netmask 255.255.255.255
2.) i have to use the command line tool telnet to set the routes. don't know why the web-gui command tool did not work...

so finally i could add a route with:
"route add -net 50.16.250.15 gw 172.16.73.113 netmask 255.255.255.255 dev tun0"

Thanks for all your replys!

Best regards,
Bernd
BasCom
DD-WRT Guru


Joined: 29 Jul 2009
Posts: 1378
Location: Germany

PostPosted: Wed May 16, 2012 9:40    Post subject: Reply with quote
you´ll never told us,using webgui command line tool Rolling Eyes
_________________
RT-N66U @ Build 25697M K3.10.63
TL-WR842ND v1 @ BS-build 23919 WDS AP
TL-WR841ND @ BS-build 23919 WDS Client
TL-WR841ND @ BS-build 23919 Client Bridge ( Routed )
bernd01
DD-WRT Novice


Joined: 08 May 2012
Posts: 5

PostPosted: Wed May 16, 2012 11:02    Post subject: Reply with quote
yep, you are right. i did not know, that this makes any difference Smile

Cheers,
Bernd
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum