how to determine next hop ip at Router?

how to determine next hop ip at Router?

Post by cranium.2.. » Sun, 08 May 2005 22:57:54



hello,
       I have setup a network with 4pcs as
HostA
eth0=> 192.168.1.100

Router1
eth0=>10.1.1.1
eth1=>192.168.1.1

Router2
eth0=>10.1.1.100
eth1=>172.16.1.1

HostB
eth0=>172.16.1.100

And set Router1 and Router2 as packet forwarder(Router). Now what i
want is when i send a packet from HostA to HostB packet is still sent
as src ip=192.168.1.100 and dest ip=172.16.1.100 its ok but how can i
check at Router1 that packet is Direct Delivery or Indirect Delivery?
What i want that i should get information at Router1 that whaterver
HostA sends a packet with dest ip 172.16.1.100 i should get that next
ip to which packet is going to be forwarded. In here i want to get
information
that though dest ip is 172.16.1.100 the next ip is 10.1.1.100?
         How to get that info???

 
 
 

how to determine next hop ip at Router?

Post by soulimane.mam.. » Mon, 09 May 2005 20:26:41


Hi
1) to check what is happening use tcpdump
2) for host a to send data to host b u have to add the default routes
     or use the iproute2 tables  to define diffrent paths for diffrent
traffic
Good Luck

 
 
 

how to determine next hop ip at Router?

Post by David Efflan » Tue, 10 May 2005 01:36:09



Quote:> hello,
>        I have setup a network with 4pcs as
> HostA
> eth0=> 192.168.1.100

> Router1
> eth0=>10.1.1.1
> eth1=>192.168.1.1

> Router2
> eth0=>10.1.1.100
> eth1=>172.16.1.1

> HostB
> eth0=>172.16.1.100

> And set Router1 and Router2 as packet forwarder(Router). Now what i
> want is when i send a packet from HostA to HostB packet is still sent
> as src ip=192.168.1.100 and dest ip=172.16.1.100 its ok but how can i
> check at Router1 that packet is Direct Delivery or Indirect Delivery?
> What i want that i should get information at Router1 that whaterver
> HostA sends a packet with dest ip 172.16.1.100 i should get that next
> ip to which packet is going to be forwarded. In here i want to get
> information
> that though dest ip is 172.16.1.100 the next ip is 10.1.1.100?
>          How to get that info???

If all routing is correct, and HostB is not behind NAT or masquerade, and
nothing else blocks traceroute responses, then from HostA do:

/usr/sbin/traceroute 172.16.1.100

 
 
 

1. Next hop and o/p i/f IP address

Hi list
        Sorry to bother you with such a trivial query.

To make a routing decision ip_route_input() is called. It fills the skb->dst
with appropriate entry. Can anyone point to the exact location where I can find
the next hop and output interface IP address.

It seems
skb->dst->dev->ip_ptr->in_dev->ifa_list->ifa_address is o/p i/f ip address and
skb->dst->neighbour->dev->ip_ptr->in_dev->ifa_list->ifa_address  is next hop IP
                                                                                address

Please correct me if I am wrong.
Thanks for all the help.

Manoj

__________________________________________________
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Sendmail aliases question.

3. Puzzle: Determine router's IP address

4. Soundblaster problem

5. HOP HOP and skip with PINE

6. "Intel netportExpress Pro 100" printserver

7. Simulate multiple router hops with one PC?

8. Thanks for the help, Microsoft

9. IP Hops

10. Is there a Solaris IP hop count parameter ?

11. Determining next cron event

12. Determining Next UID

13. Traceroute not displaying getway IP address within Hops