Operating System - HP-UX
1823986 Members
4605 Online
109667 Solutions
New Discussion юеВ

Determining which IP using lanscan

 
SOLVED
Go to solution
lawrenzo
Trusted Contributor

Determining which IP using lanscan

Hello,

I have run lanscan and 7 cards have been displayed up on the system. I have run ftp using an alias host name and I need to determine which card was used to transfer the data. (HPUX 11.00)

what command can I use.

thanks in advance
hello
5 REPLIES 5
Kurt Beyers.
Honored Contributor

Re: Determining which IP using lanscan

Hi,


Do a ping towards the alias name to find the IP address and use the command 'ifconfig lan?' to find the IP address of the lan? card.

Kurt
Elmar P. Kolkman
Honored Contributor

Re: Determining which IP using lanscan

'netstat -in' shows up all lan cards (and aliases) with their IP address and subnet...
Changing -in into -i will show them with names instead of IP addresses.
Every problem has at least one solution. Only some solutions are harder to find.
Stuart Abramson_2
Honored Contributor
Solution

Re: Determining which IP using lanscan

On HP-UX 11.11 the primary lan card is the one that has the same server IP address in column 1 and 2 of the "netstat -rn", and has flag = "UG".

In my case, below, it's lan0 at 0/0/0/0:

# lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
0/0/0/0 0x0010837C72B4 0 UP lan0 snap0 1 ETHER Yes 119
1/10/0/0 0x0060B0B3D9CA 1 UP lan1 snap1 2 ETHER Yes 119

# netstat -rn
Routing tables
Dest/Netmask Gateway Flags Use Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 19458 lo0 4136
172.20.202.103 172.20.202.103 UH 0 1857235 lan0 4136
172.20.205.103 172.20.205.103 UH 0 0 lan1 4136
172.20.202.0 172.20.202.103 U 2 0 lan0 1500
127.0.0.0 127.0.0.1 U 0 0 lo0 4136
default 172.20.202.1 UG 0 0 lan0 1500
acshps03 (172.20.202.103) at 0:10:83:7c:72:b4 ether permanent published
Current Speed = 100 Full-Duplex Auto-Negotiation-OFF

Now, however, note that I have two IP addresses on two seperate LANs. You have to know which LAN you used to get from here to there.
Steven E. Protter
Exalted Contributor

Re: Determining which IP using lanscan

lanid=$(lanscan | awk {'print $5'})

ipaddy=$(ifconfig $lanid | awk ('print $2'})

You can add a grep to the first statement to filter your ouput and get it for one lan card.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
lawrenzo
Trusted Contributor

Re: Determining which IP using lanscan

Thanks all for your assistance - I can use utilize all these commands to enhance my skills!
hello