You are not logged in.

#1 2016-01-31 07:16:52

medicineman25
Member
Registered: 2014-12-03
Posts: 110

[SOLVED] Using wildcards in routing tables to define whole ip ranges

So, I have setup a pptp to a remote worksite and everything there seems to be fine. I have configured all my routes correctly by simply defaulting everything through the ppp0 interface.

 #sudo ip route add default dev ppp0 

I have several different networks at the remote site ranging from 10.10.*.* all the way through 192.168.*.* at random intervals.

However, I would like to know if you can setup a routing table so as to route an entire ip range through the ppp0 interface, or any interface for that matter, via the use of wildcards.

For example:

 #sudo ip route add 192.168.*.* dev ppp0
 #sudo ip route add 10.*.*.* dev ppp0 

[EDIT]
Just to clarify this is not about the receiving end; I realise that if I cannot access different networks at the destination end, then that would be an onsite routing problem. Here I am trying to achieve outputting relevant network packets to the ppp0 interface without having to default everything to that interface, as doing so is a pain to setup and breakdown before and after each login session.

Thanks in advance for your time ladies and gents.

Last edited by medicineman25 (2016-01-31 12:17:00)

Offline

#2 2016-01-31 12:05:58

aiBo
Member
Registered: 2010-11-10
Posts: 50

Re: [SOLVED] Using wildcards in routing tables to define whole ip ranges

Just specify a network range using CIDR notation like so:

# ip route add 192.168.0.0/16 dev ppp0
# ip route add 10.0.0.0/8 dev ppp0

This will route any traffic to IPs matching your wildcard pattern via ppp0 interface.

Offline

#3 2016-01-31 12:16:28

medicineman25
Member
Registered: 2014-12-03
Posts: 110

Re: [SOLVED] Using wildcards in routing tables to define whole ip ranges

Oh dear. How simply obvious. Of course. Thank you.

Offline

Board footer

Powered by FluxBB