Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Routing weird IPs

38 views
Skip to first unread message

Paulo Santos

unread,
Jul 27, 2011, 10:10:01 AM7/27/11
to
Hello list,

We have an Asterisk PBX running on Debian with 1 NIC. We're adding a SIP
trunk and, for that, the ISP/ITSP installed a router/gateway (I think
that's what it is).

They've told me I needed to have configuration like this:

PBX IP: 10.120.43.153
Gateway: 10.120.43.158
Netmask: 255.255.255.248

Plus this routes:

10.0.0.0 /255.0.0.0 - 10.120.43.158
62.48.163.64/255.224.0.0 - 10.200.34.158
192.168.168.0/255.255.255.192 - 10.120.43.158

I also need the PBX be in the our network as well, 192.168.0.200. For
that I created an alias and now I have my interfaces like this:

auto eth0
iface eth0 inet static
address 192.168.0.200
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.254

auto eth0:0
iface eth0:0 inet static
address 10.120.43.153
netmask 255.255.255.248
gateway 10.120.43.158


I've added the 10.0.0.0 route fine:

route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.120.43.158


But when I try any of the other 2, I get:

route: bogus netmask 255.225.255.192
Usage: ...

Or:

route: netmask doesn't match route address
Usage: ...

I've tried with "-host" as well and got:

route: netmask 001fffff doesn't make sense with host route
Usage: ...


Does anyone knows what's wrong or what do they mean by those configs?

Best regards,
Paulo Santos


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/4E301A6E...@sapo.pt

Ivan Shmakov

unread,
Jul 27, 2011, 12:10:01 PM7/27/11
to
>>>>> Paulo Santos <paulo.r...@sapo.pt> writes:

[…]

> Plus this routes:

> 10.0.0.0 /255.0.0.0 - 10.120.43.158
> 62.48.163.64/255.224.0.0 - 10.200.34.158
> 192.168.168.0/255.255.255.192 - 10.120.43.158

The last one should probably be as follows instead:

192.168.160.0/255.255.255.192 - 10.120.43.158

[…]

--
FSF associate member #7257


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/86sjprn...@gray.siamics.net

Paulo Santos

unread,
Jul 27, 2011, 5:10:03 PM7/27/11
to
Ivan Shmakov wrote:
> Paulo Santos<paulo.r...@sapo.pt> writes:
>> ...

>> 192.168.168.0/255.255.255.192 - 10.120.43.158
>
> The last one should probably be as follows instead:
>
> 192.168.160.0/255.255.255.192 - 10.120.43.158

Why is that?

I tried it, though, but I get the same behaviour.

Best regards,
Paulo Santos


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/4E307CBF...@sapo.pt

François TOURDE

unread,
Jul 27, 2011, 6:00:03 PM7/27/11
to
Le 15182ième jour après Epoch,
Paulo Santos écrivait:

> Hello list,
>
> We have an Asterisk PBX running on Debian with 1 NIC. We're adding a
> SIP trunk and, for that, the ISP/ITSP installed a router/gateway (I
> think that's what it is).
>
> They've told me I needed to have configuration like this:

[... some config details ...]

Please, re-check your mail, because of probably lot of typo errors...

> Plus this routes:
>
> 10.0.0.0 /255.0.0.0 - 10.120.43.158
> 62.48.163.64/255.224.0.0 - 10.200.34.158
> 192.168.168.0/255.255.255.192 - 10.120.43.158

If your syntax is "ip/mask - gateway", then the second line use a
gateway not in your ip range (10.200... vs 10.120...), or this is a typo
error.

> I also need the PBX be in the our network as well, 192.168.0.200. For
> that I created an alias and now I have my interfaces like this:
>
> auto eth0
> iface eth0 inet static
> address 192.168.0.200
> netmask 255.255.255.0
> network 192.168.0.0
> broadcast 192.168.0.255
> gateway 192.168.0.254
>
> auto eth0:0
> iface eth0:0 inet static
> address 10.120.43.153
> netmask 255.255.255.248
> gateway 10.120.43.158

You can't have 2 gateway lines, because gateway is equiv to "route
default", and you can't have 2 default destinations.

> But when I try any of the other 2, I get:
>
> route: bogus netmask 255.225.255.192
> Usage: ...

Look at the "225" instead of "255" in the second byte of the netmask. Is
it a typo error?

Please use cut and paste of your commands and the results in your next
mail, to avoid errors and to permit a good diagnosis.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/871uxb8...@fermat.tourde.home

Ivan Shmakov

unread,
Jul 27, 2011, 10:10:01 PM7/27/11
to
>>>>> Paulo Santos <paulo.r...@sapo.pt> writes:
>>>>> Ivan Shmakov wrote:
>>>>> Paulo Santos<paulo.r...@sapo.pt> writes:

>>> 192.168.168.0/255.255.255.192 - 10.120.43.158

>> The last one should probably be as follows instead:

>> 192.168.160.0/255.255.255.192 - 10.120.43.158

> Why is that?

> I tried it, though, but I get the same behaviour.

Apparently, my eye has slipped. There's no issue with this
IP/netmask pair. Rather, I see the issue with the other one:

>>> 62.48.163.64/255.224.0.0 - 10.200.34.158

It's the convention to have the masked-out bits of a network IP
address to be zero. And my guess is that route(8) may fail with
the following if this convention isn't followed:

>>> route: netmask doesn't match route address

In this case:

62.48.163.64 00111110 00110000 10100011 01000000
255.224.0.0 11111111 11100000 00000000 00000000

So, it should've probably been as follows instead:

62.32.0.0/255.224.0.0

--
FSF associate member #7257

--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/867h73m...@gray.siamics.net

Paulo Santos

unread,
Jul 28, 2011, 9:20:01 AM7/28/11
to
Hello,

First of all, than you everyone for the replies.

François TOURDE wrote:
> Le 15182ième jour après Epoch,
> Paulo Santos écrivait:

>> Plus this routes:
>>
>> 10.0.0.0 /255.0.0.0 - 10.120.43.158
>> 62.48.163.64/255.224.0.0 - 10.200.34.158
>> 192.168.168.0/255.255.255.192 - 10.120.43.158
>
> If your syntax is "ip/mask - gateway", then the second line use a
> gateway not in your ip range (10.200... vs 10.120...), or this is a typo
> error.

It is "IP/Mask - Gateway". Those 3 lines are a copy&paste of the email
the provider sent me. Seeing it is impossible for the 2nd line to work,
I'll contact them to clarify it.


> You can't have 2 gateway lines, because gateway is equiv to "route
> default", and you can't have 2 default destinations.

Ok. I'll correct that in the end of the day, since it's in production I
can't restart the network.


>> But when I try any of the other 2, I get:
>>
>> route: bogus netmask 255.225.255.192
>> Usage: ...
>
> Look at the "225" instead of "255" in the second byte of the netmask. Is
> it a typo error?

Indeed it is a typo made when executing the command. Correcting it
worked, the route was added.

Best regards,
Paulo Santos


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/4E3161B3...@sapo.pt

François TOURDE

unread,
Jul 28, 2011, 11:40:02 AM7/28/11
to
Le 15183ième jour après Epoch,
Paulo Santos écrivait:

>> You can't have 2 gateway lines, because gateway is equiv to "route


>> default", and you can't have 2 default destinations.
>
> Ok. I'll correct that in the end of the day, since it's in production I
> can't restart the network.

You don't need to restart the network. Check the default routes actives
using "ip route", and then delete the wrong one with "ip route del <your
bad route>"

Hope this help.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/878vriw...@fermat.tourde.home

Paulo Santos

unread,
Jul 28, 2011, 1:40:02 PM7/28/11
to
Paulo Santos wrote:
> François TOURDE wrote:
>> Le 15182ième jour après Epoch, Paulo Santos écrivait:
>>> Plus this routes:
>>>
>>> 10.0.0.0 /255.0.0.0 - 10.120.43.158 62.48.163.64/255.224.0.0 -
>>> 10.200.34.158 192.168.168.0/255.255.255.192 - 10.120.43.158
>>
>> If your syntax is "ip/mask - gateway", then the second line use a
>> gateway not in your ip range (10.200... vs 10.120...), or this is a
>> typo error.
>
> It is "IP/Mask - Gateway". Those 3 lines are a copy&paste of the
> email the provider sent me. Seeing it is impossible for the 2nd line
> to work, I'll contact them to clarify it.

Well, it was an error from the provider afterall. Everything should be
OK now.

10.200.34.152/29 dev eth0 proto kernel scope link src 10.200.34.153
62.48.163.64/27 via 10.200.34.158 dev eth0
192.168.168.0/26 via 10.200.34.158 dev eth0
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.202
10.0.0.0/8 via 10.200.34.158 dev eth0
default via 192.168.0.254 dev eth0

If it doesn't work, it probably is something else other than routes.

unruh wrote:
>>> You can't have 2 gateway lines, because gateway is equiv to
>>> "route default", and you can't have 2 default destinations.

> ?? I do not think I agree. The gateway simply says -- if you get an
> address that matches the route, send the packet on to the gateway to
> deal with it. It is NOT the equivalent of a default route (which is--
> if the address does not match anything else in the route, ship it on
> to default gateway to deal with). A specific gateway is not
> equivalent to a default gateway.

In that case, having it declared in the interfaces is the same as
configuring a route manually, right?

Best regards,
Paulo Santos

--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/4E319CF2...@sapo.pt

0 new messages