1829850 Members
2807 Online
109993 Solutions
New Discussion

ip routing problem

 
Jerry Shen_1
Occasional Advisor

ip routing problem

Please help:

I have an ip routing problem.

On redbirda:
First network interface (lan0):
Private network: 192.168.254.0/24.
IP: 192.168.254.201.
Second network interface (lan0:1):
external network: x1.x2.0.0/16. It's IP address is x1.x2.x3.x4. (Sorry, I have to hide the real ip address)
Default dateway for redbirda is an external router: x1.x2.0.1.

From redbirda, ping always works, either x1.x2.0.0 network or internet.

===================================
#redbirda : / (root) # netstat -rn
Routing tables
Dest/Netmask Gateway Flags Refs Use Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 1791 lo0 4136
x1.x2.X3.x4 x1.x2.X3.x4 UH 0 2776532 lan0:1 4136
192.168.254.201 192.168.254.201 UH 0 2750673 lan0 4136
192.168.254.0 192.168.254.201 U 3 0 lan0 1500
x1.x2.0.0 x1.x2.x3.x4 U 3 0 lan0:1 1500
127.0.0.0 127.0.0.1 U 0 0 lo0 4136
default x1.x2.0.1 UG 0 0 lan0:1 1500
===================================


On redbirdb:
Network interface (lan0):
Private network: 192.168.254.0/24.
IP: 192.168.254.202.
Default gateway: redbirda(192.168.254.201).

From redbirdb, ping redbirda0(x1.x2.x4.x4) sucessful.
From redbirdb, ping other x1.x2.0.0 IP will fail. TraceRoute will stop at redbirda.
For example: linkloop to x1.x2.0.1 return OK from redbirdb, but ping failed.

===================================
#redbirdb : / (root) # netstat -rn
Routing tables
Dest/Netmask Gateway Flags Refs Use Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 6952 lo0 4136
192.168.254.202 192.168.254.202 UH 0 2186416 lan0 4136
192.168.254.0 192.168.254.202 U 2 0 lan0 1500
127.0.0.0 127.0.0.1 U 0 0 lo0 4136
default 192.168.254.201 UG 0 0 lan0 1500
===================================

How can I configure redbirda and redbirdb so that redbirdb (and similar nodes) is able to ping x1.x2.0.0 network and internet?

Thanks.

Jerry Shen
11 REPLIES 11
Jerry Shen_1
Occasional Advisor

Re: ip routing problem

Oops, typo:
Host name redbirda0's IP address should be x1.x2.x3.x4, the second network interface of redbirda.

Thanks.

Jerry Shen
steven Burgess_2
Honored Contributor

Re: ip routing problem

Hi Jerry

Add a route to that network via the gateway then a permanent entry in the netconf file

route add

Your netconf entry

ROUTE_DESTINATION[1]="net "
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]=
ROUTE_COUNT[1]=1
ROUTE_ARGS[1]=""

The numbers in the [ ] go up for each route added

HTH

Steve
take your time and think things through
Ray Brewer
Valued Contributor

Re: ip routing problem

Have you tried adding a route to redbirda from 192.168.254.201 to network x1.x2.0.0?
ie. "route add net 192.168.254.201 x1.x2.0.0 1"
It looks to me that since your default gateway for redbirdb is the 192.168.254.201 interface on redbirda that you would need a route to go from that interface to the x1.x2.0.0 network. You would then want to modify netconf to make this permanent. I'm not certain if this will work in your situation but it's similar to things we have had to do here.

Ray
Jerry Shen_1
Occasional Advisor

Re: ip routing problem

Steve, Ray:

On redbirda, when I do:
#redbirda : / (root) # route add net x1.x2.0.0 netmask 255.255.0.0 192.168.254.201 1
The error massage is:
add net x1.x2.0.0: gateway 192.168.254.201: Network is unreachable.

I have been trying to add this for a while, but it always gave me the error message.

Please help, thanks.

Jerry Shen
steven Burgess_2
Honored Contributor

Re: ip routing problem

Hi Jerry

I don't think you can add a route to another network via your own interface

Try from redbirdb

route add net x1.x2.0.0 255.255.0.0 192.168.254.201

What does that return

It will be interesting to see how this works out

HTH

Steve



take your time and think things through
Jerry Shen_1
Occasional Advisor

Re: ip routing problem

Steve:

I have done that on redbirdb before. After run {"route add net x1.x2.0.0 netmask 255.255.0.0 192.168.254.201 1"} on redbirdb, the netstat -rn will add:

x1.x2.0.0 192.168.254.201 UG 0 0 lan0 1500

Compare it to the default route:

default 192.168.254.201 UG 0 0 lan0 1500

I think these 2 routes are identical.

By the way, ping x1.x2.0.1 does not work after that as well.

Please help.

Thanks.

Jerry Shen

Ray Brewer
Valued Contributor

Re: ip routing problem

Sorry about that, Try the same route add that I gave you but leave off the route count of 1 at the end.

ie. "route add net x1.x2.0.0 192.168.254.201"

I tested it here and that seems to work.

Ray
Jerry Shen_1
Occasional Advisor

Re: ip routing problem

Ray:

On redbirda, after:
"route add net x1.x2.0.0 192.168.254.201"
"netstat -rn" adds:
x1.x2.0.0 192.168.254.201 U 0 0 lan0 1500

On redbirdb, problem still exists:
========================
traceroute to x1.x2.0.1 (x1.x2.0.1), 30 hops max, 20 byte packets
1 redbirda (192.168.254.201) 2 ms 1 ms 1 ms
2 * * *
3 * * *
...
========================

Please help.

Thanks.

Jerry Shen
Ron Kinner
Honored Contributor

Re: ip routing problem

I replied to this several hours ago but it seems to have gotten lost so please excuse if you suddenly get double posts.

To get redbirda to talk to hosts on the x1 net requires three things:

One: A default route on redbirda pointing to redbirdb. This you have.

Two: IP_Forwarding has to be on on redbirdb. If it's 11.0 it's on by default but you can check it with:

ndd -get /dev/ip ip_forwarding

You should get 2 as an answer. Which means it is on if you have 2 or more interfaces. If you have an earlier version which doesn't use ndd then try
nettune -l |grep forward
and see what you get. I don't have one to play with anymore.

Three: Requirement one gets us to redbirdb, two gets us through redbirdb to the x1 LAN and its hosts. We can assume the hosts are getting the packets since redbirdb can ping them. Now in order to get a reply back the hosts on x1 have to have a route to the 192.168.254.0 network by way of redbirdb's X1 address. Assuming everyone on X1 uses the router as their default gateway the simplest thing to do this is to add the route to the router. If it's a Cisco then from enable mode it's simply:

conf t
ip route 192.168.254.0 255.255.255.0 x1_address_of_redbirdb
end
wr me

Now when they get a packet and they want to reply they can send it to the router and he can take care of it for them (actually he will send a redirect to them which will tell them to use the x1_address_of_redbirdb but you won't know the difference).

OK, that will get you to the x1 hosts but you still can't talk to the internet. In order to get to the internet you need a legal address. 192.168.x.y is a "private" address which is illegal on the internet. In order to get it to work you have to use Network Address Translation (NAT). Nat just changes the source address on an outgoing packet to a legal address and does the reverse to the destination address on an incoming packet. THis fools the internet into letting the packet go out and gives it a way to get back to you. Since 11.0 does not even offer NAT and most routers do you would be better off letting the router do it for you. (I understand you can get ipfilter to do this for you. It's a freeware program but I would have to look up the address - don't have it now tho I did have it for my earlier post. Curses!)

How you implement it on the router depends on your architecture. Is there only one host on the 192.168.254 LAN that needs to do this or is there a whole flock of redbirds? Is it a Cisco router? Does it's IOS support NAT?

Ron



Jerry Shen_1
Occasional Advisor

Re: ip routing problem

Ron:

I believe you mixed redbirda and redbirdb. Anyway, requirement 1 and 2 are met on redbirda, redbirdb, etc., but the requirement 3: "add a route to the 192.168.254.0" from x1.x2 default gateway is not that easy for me to do. Not even NAT.

This is my own testing private network with 3 hpux 11 boxes (redbirds) in office and try to facilitate the corp's network.

I guess there's no way out if I don't change x1.x2's gateway setting. (:(

Thank you. Also thank Steve and Ray.

Jerry Shen
Ron Kinner
Honored Contributor

Re: ip routing problem

Yes I guess I mixed up the birds. Sorry. You get the idea tho. You can still do 3 by going to the single NIC bird on the x1 network and adding a route back to the single NIC bird on the 192 network. Then at least the 3 birds can talk.

You can still implement NAT on the dual NIC bird with IPFilter and solve all of your problems. See the following link:

http://cheops.anu.edu.au/~avalon/ipf-mentat.html

That seems to assume 11.0. Don't know what you have or if ipfilter only works with 11.0 but your other alternative is to add a cheap LINUX box to do the NAT for you. It will need two NICs with a presence on both the x1 and the 192 networks. It would then become your gateway for the 192 network bird.

Of course you could use a router in the same position.

Ron