1825719 Members
2934 Online
109686 Solutions
New Discussion

Routing in two lans

 
SOLVED
Go to solution

Routing in two lans

I have a D210 with one lan card and o ip is 10.0.0.22 and a K460 with two cards one ip is 10.0.0.12 and other is 192.168.0.132 and i want that server D210 go out by the lan 192.168.0.132. Who i can do this? Thanks!
4 REPLIES 4
Chris Wilshaw
Honored Contributor

Re: Routing in two lans

try

route add host 10.0.0.22 192.168.0.132 1

Depending on your network config, you may need to add a netmask

route add host 10.0.0.2 netmask 192.168.0.132 1

Once you've got it working, don't forget to add the details to /etc/rc.config.d/netconf in order to make the new route permanent.
RAC_1
Honored Contributor

Re: Routing in two lans

Could not really get what you want.
Do you want D120 talk to K460 on ip address 192.168.0.132, then the ip_address should be reachable from D210. On D210, the K460 will be known with ip address - 192.168.0.132.

In /etc/hosts (if you are using /etc/hosts for host name resolution) the entry for K460 will look like follows.

192.168.0.132 fully_qualified domain_name_of_K460

Anil
There is no substitute to HARDWORK

Re: Routing in two lans

I want that D210 by K460 access the network 192.168.0. Thanks RAC
Ron Kinner
Honored Contributor
Solution

Re: Routing in two lans

It would help if you would give your HPUX version and your masks. I am assuming 11.0 or higher and 255.255.255.0 masks.

The gateway has to be on a local LAN and since you want to access everything on the 192.168.0.0 (mask 255.255.255.0 I assume) you would do

route add 192.168.0.0 netmask 255.255.255.0 10.0.0.12 1

I assume the K460 responds to Pings otherwise we will need to make another ndd change.

This will get the packet to the K460 but you should probably check that the K460 has ip_forwarding turned on with:
ndd -get /dev/ip ip_forwarding

You should get a 1 back if you get 0 then

ndd -set /dev/ip ip_forwarding 1

and edit /etc/rc.config.d/nddconf to add:

TRANSPORT_NAME[0]=ip
NDD_NAME[0]=ip_forwarding
NDD_VALUE[0]=1


If there is already an entry then you have to change the numbers in brackets to the next higher number.



Now the packets are being sent to the K460 and relayed onto the 192.168.0 network. In order for the devices on this LAN to reply they need to know about the new path to the 10.0.0 LAN via the 192.168.0.132 gateway otherwise nothing is going to work. You either have to add a route on each host or if these use a default router you can tell the router about it and it will redirect the hosts to the correct gateway.

Don't expect the D210 to be able to reach the Internet even if the hosts on the 192.168.0 network can. The router or firewall upstream is doing NAT and converting the 192.168.0 addresses to a legal address. It will not know that it is supposed to do the same to the 10.0.0 stuff unless you tell it and most of the cheap routers only can NAT one LAN. You could get the K460 to do the NAT and convert the 10.0.0.12 to 192.168.0.132 but you will need some extra software like ipfilter.

Ron