Operating System - HP-UX
1834227 Members
2803 Online
110066 Solutions
New Discussion

force packets to pass through a specified segment

 
SOLVED
Go to solution
Hanry Zhou
Super Advisor

force packets to pass through a specified segment

I have two NIC's on a hpux box,
a.b.x.3
a.b.y.5

a.b.x.1 is the the gateway for default, now if I want to ping a destination, and have ping command go through the NIC of a.b.y.5. Can I do that? and how?

Thanks,
none
4 REPLIES 4
Shannon Petry
Honored Contributor

Re: force packets to pass through a specified segment

First,

Why ask the same question 3 times? Wont get results any better, and maybe even worse.

Second,

No, you can not force the traffic through a specific NIC as it's either address or router specific.

If your trying to ping something outside of your defined networks, all traffic will go through the default router.

The way that TCP/IP works is very well documented and established. You may want to pick up a book by O'Reilly and Associates on TCP/IP (the definitive guide).

If you are configured to go through a gateway, you can not take 1 packet type and move it to a different NIC. It's an all or nothing scenario.

Regards,
Shannon
Microsoft. When do you want a virus today?
Ron Kinner
Honored Contributor
Solution

Re: force packets to pass through a specified segment

You can do it but it's a bit of work. First you have to add a route to the destination you want to ping and make sure that it points to a gateway on the a.b.y network. Say you want to reach C.D.E.F and that there is a gateway at a.b.y.254 then you could say something like:
route add net C.D.E a.b.y.254 1
(I think that's the right format for HPUX but I'm going from memory here so check your man page for route. You need the 1 so it will know that the gateway is not itself. You might prefer to do a route to a single host then you would have the least impact on other operations) Verify that the route took by doing
netstat -rn

Now when you ping it will check the routing table and find that the route goes out through a.b.y.5 and it will take that route. You might want to do
traceroute C.D.E.F
instead of a ping. That will prove that it went the correct way.

When you are finished you will probably want to put it back the way it was with a route delete

Ron
Hanry Zhou
Super Advisor

Re: force packets to pass through a specified segment

Shannon,

I did not purposely create 3 same messages.

The web page did not move on to next page when I first time click the "Submit" bottom, so I clicked twice. This caused 2 messages coming up.

After I submit the page, I thought that it might be better to ask the question in "networking" section, in stead of "administration" section. So, I did it again.

Sorry for the confusion, and I learnt the process of sumitting questions.

Anybody else for my question?
none
Edgar Avila
Frequent Advisor

Re: force packets to pass through a specified segment

On HPUX the only way it's to define a new route to the host/net you want to reach.

route add host h.o.s.t g.a.t.e
or
route add net n.e.t.w m.a.s.k mask g.a.t.e

you'll send the packet tru the corresponding NIC.

Knowledge is power... so... give me the power!!