Just to throw it out there, I created the attached op script a while ago to do this in a small office environment. It does require having a family inet address on the switch (so don't forget your firewall filters to prevent cross-vlan contamination!)
Next on my todo list was for it to run through a list of switches running the get-ethernet-switching-table-information remotely, so that it could be used on a larger LAN without inet addressing each switch. And inet6, of course. Thanks, Jed. On 27 August 2014 01:31, Per Granath <[email protected]> wrote: > This might be interesting: http://youtu.be/Le9S2rj_qXI?t=19m46s (starting > from 19m and 46s into the video). > > > -----Original Message----- > From: juniper-nsp [mailto:[email protected]] On Behalf > Of Evangelos Kanarelis > Sent: Tuesday, August 26, 2014 3:43 PM > To: [email protected] > Subject: Re: [j-nsp] juniper switch ex2200 how to find port from ip > address? > > This has now been resolved. > > Managed to get access to the core switch and used the arp table. > > Thank you all for your help :-) > > Angelo Kanarelis > Infrastructure Support Engineer > > > > T: +44 (0) 207 421 2575 M: +44(0) 779 5613721 2nd Floor, Nexus Place, 25 > Farringdon Street, London, EC4A4AB > > > -----Original Message----- > From: juniper-nsp [mailto:[email protected]] On Behalf > Of Phil Mayers > Sent: 26 August 2014 13:06 > To: [email protected] > Subject: Re: [j-nsp] juniper switch ex2200 how to find port from ip > address? > > On 26/08/14 12:22, Evangelos Kanarelis wrote: > > Hello everybody > > > > I am relatively new to networking and I am currently managing a few > > EX2200 switches. > > > > I need to find to which port a machine is connected to, but all I have > > is an IP Address. I know that I can use show ethernet-switching table > > brief but unfortunately I do not have the MAC address. > > > > Any help would be greatly appreciated. > > When you have time, consider looking into running something like Netdisco > against your switches and routers. > > Without a MAC, it's not straightforward. > > It's not really difficult either, but if you're new to networking all the > suggestions I can think of (put an IP address on the ports vlan, ping the > host, look in the ARP table; put a logging firewall filter in, look for > matches; enable DHCP/ARP snooping) carry a risk of breaking things. > > It would be a lot easier if you could find the MAC address from the > router. Can you really not do that? > > Or if you can get to the host, just unplug then re-attach the host, then > look in the switch logs for which port just came up. > > If not, the "safest" thing is probably to modify the switch to have an IP > address on the port VLAN and ping the host, then find the MAC from the ARP > table like so: > > == Add the IP to the vlan == > > configure > set vlan <name> l3-interface vlan.<tag> > set interfaces vlan unit <tag> family inet address <ip/mask> commit > > == Find the IP/MAC/port == > > run ping <ip> count 1 > run show arp no-resolve hostname <ip> > run show ethernet-switching table | match <MAC from the ARP output> > > == Undo adding the IP > > rollback 1 > commit > > _______________________________________________ > juniper-nsp mailing list [email protected] > https://puck.nether.net/mailman/listinfo/juniper-nsp > > _______________________________________________ > juniper-nsp mailing list [email protected] > https://puck.nether.net/mailman/listinfo/juniper-nsp > > _______________________________________________ > juniper-nsp mailing list [email protected] > https://puck.nether.net/mailman/listinfo/juniper-nsp > _______________________________________________ juniper-nsp mailing list [email protected] https://puck.nether.net/mailman/listinfo/juniper-nsp

