Ethernet Switching
Ethernet Switching

how to find IP address of other end interface link connected to neighbor machine

‎05-10-2019 04:00 PM

Hi,

 

Consider I have 2 juniper devices A & B

A & B are connected with the phyiscal interface.

 

I logged in to A device & I know the IP address on connected physical interface end.

How to find from machine A what is the IP address of other physical interface end which is connected to device B.

 

 

Thanks,

Nilesh

9 REPLIES 9
Ethernet Switching

Re: how to find IP address of other end interface link connected to neighbor machine

‎05-10-2019 07:44 PM

 Hi nileshbhadane,

 

I'm assuming you're troubleshooting a connectivity issue.   There's no standard way to know this, but some fun ideas:

a) If you expect to receive any L3 protocol traffic from the peer, just apply an input firewall filter and log packets matching the protocol in question.

 

Example:

set firewall family inet filter test term 1 from protocol ospf

set firewall family inet filter test term 1 then log

set firewall family inet filter test term 1 then discard

set firewall family inet filter test term 2 then accept

wait for a minute and once interface can see input packets (show interfaces extensive), then check:
show firewall log

 

https://www.juniper.net/documentation/en_US/junos/topics/reference/command-summary/show-firewall-log...

 

b) If you have ISIS enabled on both ends there will be an Interface address TLV  in the IIS hello (IIH) packet that includes interface address.  

 

Example:

IPv4 Interface address(es) TLV #132, length: 4
IPv4 interface address: 68.86.2.195
0x0000: 4456 02c3

 

Hope this helps.

 

Regards,
-r.

--------------------------------------------------

If this solves your problem, please mark this post as "Accepted Solution."
Kudos are always appreciated Smiley Happy.

Ethernet Switching

Re: how to find IP address of other end interface link connected to neighbor machine

‎05-12-2019 04:53 AM

On the device A use this command substituting the interface of interest.

show arp interface  ge-0/0/0.0

 

This will show the mac and ip address of connected other interfaces.

If none show up, issue a ping to the addresses in the subnet of the interface and check again afterwards for the refreshed mac listing.

 

Steve Puluka BSEET - Juniper Ambassador
IP Architect - DQE Communications Pittsburgh, PA (Metro Ethernet & ISP)
http://puluka.com/home
Ethernet Switching

Re: how to find IP address of other end interface link connected to neighbor machine

‎05-12-2019 10:54 PM

A simple way would be to check the exact IP subnet configured on Device A interface.

If it is connected to a Switch/Router then usually it is a point to point link so it could be /31 or /30. So it should tell us what could be the ip address on the other side.

If the interface is connected to the host/server then i believe we can check with lldp output as well (provided that it is configured on the other side).

If not then we might have to use the method of firewall logs etc...

 

Show lldp neighbor

 

 

Hope this helps.

 

 

Ethernet Switching

Re: how to find IP address of other end interface link connected to neighbor machine

‎05-13-2019 02:59 AM

show lldp neighbor only shows the mac address of the connected interfaces configured with lldp not the ip address.

 

Steve Puluka BSEET - Juniper Ambassador
IP Architect - DQE Communications Pittsburgh, PA (Metro Ethernet & ISP)
http://puluka.com/home
Ethernet Switching

Re: how to find IP address of other end interface link connected to neighbor machine

‎05-13-2019 03:03 AM

Remeber arp will only work till the time entries are present. If the arp timeout has already happened and the entries are flushed out then just simply ping .255 of the subnet and check for the arp.

 

Example

regress@vqfx2> ping 172.16.3.255
PING 172.16.3.255 (172.16.3.255): 56 data bytes
64 bytes from 172.16.3.255: icmp_seq=0 ttl=64 time=13.179 ms
64 bytes from 172.16.3.255: icmp_seq=1 ttl=64 time=10.105 ms
64 bytes from 172.16.3.255: icmp_seq=2 ttl=64 time=8.467 ms

 

regress@vqfx2> show configuration interfaces xe-0/0/0
description To-MX-1;
unit 0 {
family inet {
address 172.16.3.1/24;
}
}

 

regress@vqfx2> show arp interface xe-0/0/0.0
MAC Address Address Name Interface Flags
00:05:86:1b:54:01 172.16.3.2 172.16.3.2 xe-0/0/0.0 none

{master:0}

Firewall -filter can be helpful only if there is some protocols running on the other end and you are aware of it.Else might not be that efficient everytime.

 

 

Ethernet Switching

Re: how to find IP address of other end interface link connected to neighbor machine

‎05-13-2019 06:30 AM

Looks like the same topic was started also in JUNOS section, so I'm posting my solution here as well for people who do not follow JUNOS section of this forum.

=======================

You can try the following shell one-liner to ping all IP addresses in the subnet - even if remote device doesn't respond to ping, you should see an ARP entry for the remote IP address afterwards. In this example, our IP address is 10.1.6.1/24, and we're pinging 10.1.6.2 - 254:

start shell sh
src="10.1.6.1"; i=2; while [ $i -lt 255 ]; do cli -c "ping 10.1.6.$i rapid count 2 source $src"; sleep 1; i=$((i+1)); done;

You can also try to run it directly from CLI (supported in recent JUNOS versions):

start shell sh command "src=\"10.1.6.1\"; i=2; while [ $i -lt 255 ]; do cli -c \"ping 10.1.6.$i rapid count 2 source $src\"; i=$((i+1)); sleep 1; done" 

=======================

As for the suggeted method of pinging .255 address, some Linux boxes do not respond to such pings. In my lab I have a Centos box connected to MX, which ignores such packets (didn't check other OS though):

root@mx1> clear arp interface ge-0/0/2
10.1.6.30        deleted

root@mx1> monitor traffic interface ge-0/0/2.0 no-resolve
verbose output suppressed, use <detail> or <extensive> for full protocol decode
Address resolution is OFF.
Listening on ge-0/0/2.0, capture size 96 bytes

15:26:46.297164 Out IP truncated-ip - 24 bytes missing! 10.1.6.1 > 10.1.6.255: ICMP echo request, id 4519, seq 0, length 64
15:26:47.298044 Out IP truncated-ip - 24 bytes missing! 10.1.6.1 > 10.1.6.255: ICMP echo request, id 4519, seq 1, length 64
15:26:48.298401 Out IP truncated-ip - 24 bytes missing! 10.1.6.1 > 10.1.6.255: ICMP echo request, id 4519, seq 2, length 64
15:26:49.298715 Out IP truncated-ip - 24 bytes missing! 10.1.6.1 > 10.1.6.255: ICMP echo request, id 4519, seq 3, length 64
^C
4 packets received by filter
0 packets dropped by kernel

root@mx1> show arp | match ge-0/0/2

root@mx1>

However, unicast ping works just fine:

root@mx1> show arp | match ge-0/0/2

root@mx1> monitor traffic interface ge-0/0/2.0 no-resolve
verbose output suppressed, use <detail> or <extensive> for full protocol decode
Address resolution is OFF.
Listening on ge-0/0/2.0, capture size 96 bytes

15:27:03.027203 Out arp who-has 10.1.6.30 tell 10.1.6.1
15:27:03.029711  In arp reply 10.1.6.30 is-at 56:68:a3:16:00:a9
15:27:03.029729 Out IP truncated-ip - 24 bytes missing! 10.1.6.1 > 10.1.6.30: ICMP echo request, id 8103, seq 0, length 64
15:27:03.031543  In IP 10.1.6.30 > 10.1.6.1: ICMP echo reply, id 8103, seq 0, length 64

HTH

 

Best regards,

Sergii

-------------------------------------------------------------------

Please accept the solution if your problem is resolved Smiley Happy

-------------------------------------------------------------------

Ethernet Switching

Re: how to find IP address of other end interface link connected to neighbor machine

‎05-13-2019 07:17 AM

JUNOS also seems to drop packets destined to the broadcast address - it gets response from itself only:

root@mx1> show ospf neighbor
Address          Interface              State     ID               Pri  Dead
10.1.12.2        ge-0/0/3.0             Full      10.1.1.2         128    38

root@mx1> ping 10.1.12.255
PING 10.1.12.255 (10.1.12.255): 56 data bytes
64 bytes from 10.1.12.255: icmp_seq=0 ttl=64 time=2.589 ms
64 bytes from 10.1.12.255: icmp_seq=1 ttl=64 time=2.097 ms
64 bytes from 10.1.12.255: icmp_seq=2 ttl=64 time=2.216 ms

The other side doesn't see these packets:

root@mx2> show ospf neighbor
Address          Interface              State     ID               Pri  Dead
10.1.12.1        ge-0/0/3.0             Full      10.1.1.1         128    32

root@mx2> monitor traffic interface ge-0/0/3.0 no-resolve
verbose output suppressed, use <detail> or <extensive> for full protocol decode
Address resolution is OFF.
Listening on ge-0/0/3.0, capture size 96 bytes

16:13:03.163107  In IP 10.1.12.1 > 224.0.0.5: OSPFv2, Hello, length 60
16:13:06.667781 Out IP truncated-ip - 20 bytes missing! 10.1.12.2 > 224.0.0.5: OSPFv2, Hello, length 60
16:13:11.052336  In IP 10.1.12.1 > 224.0.0.5: OSPFv2, Hello, length 60
16:13:15.351821 Out IP truncated-ip - 20 bytes missing! 10.1.12.2 > 224.0.0.5: OSPFv2, Hello, length 60
16:13:18.634388  In IP 10.1.12.1 > 224.0.0.5: OSPFv2, Hello, length 60

Thanks,

Sergii

Ethernet Switching

Re: how to find IP address of other end interface link connected to neighbor machine

‎06-20-2019 02:23 AM

Hi,

It's also possible to use LLDP.

Please configure lldp protocol on all interfaces and chesh output from "show lldp neighbours".

abroot@jtac-mx480dc-r2017> show lldp neighbors 
Local Interface    Parent Interface    Chassis Id          Port info          System Name
ge-5/0/1           -                   80:71:1f:72:e7:c0   549                jtac-mx480dc-r2017  
ge-5/0/0           -                   80:71:1f:72:e7:c0   550                jtac-mx480dc-r2017  

In this case, I have a physical loop between ge-5/0/0 and ge-5/0/1.

 

In show lldp neighbours interface ge-5/0/0 you can find some details about your neighbour, for example IP address and Junos version:

labroot@jtac-mx480dc-r2017> show lldp neighbors interface ge-5/0/0 
LLDP Neighbor Information:
Local Information:
Index: 3 Time to live: 120 Time mark: Thu Jun 20 09:22:51 2019 Age: 0 secs 
Local Interface    : ge-5/0/0
Parent Interface   : -
Local Port ID      : 549
Ageout Count      : 0

Neighbour Information:
Chassis type       : Mac address
Chassis ID         : 80:71:1f:72:e7:c0
Port type          : Locally assigned
Port ID            : 550
Port description   : ge-5/0/1
System name        : jtac-mx480dc-r2017
  
System Description : Juniper Networks, Inc. mx480 internet router, kernel JUNOS 17.2, Build date: 2019-06-04 16:42:40 UTC Copyright (c) 1996-2019 Juniper Networks, Inc.


System capabilities 
        Supported: Bridge Router 
        Enabled  : Bridge Router 

Management address 
        Address Type      : IPv4(1)
        Address           : 10.19.5.2
        Interface Number  : 1
Ethernet Switching

Re: how to find IP address of other end interface link connected to neighbor machine

‎09-01-2019 08:26 PM

I think this topic is not yet answered and I have the same question too. Lets make an example. 

A small firewall router SRX100 has 3 interface (fe0/0, fe0/1, fe0/2) connected to end devices.

fe0/0 has fixed IP connected to a modem.

Another 2 interfaces connected to either 1 of the device below

1. An unmanged network switch

2. The WAN interface of the wireless AP

 

a. The WAN interface of the wireless AP has fixed IP and I know its IP. How do I find out it connected to fe0/1 or fe0/2?

b. A network printer has fixed IP and I know its IP, it connected to the unmanaged network switch. By using this info, how do I find out the unmanaged network switch connected to fe0/1 or fe0/2?