Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to ping using secondary ip address as source address.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
My nic has two ip address. May I know how to ping using secondary IP address as source address ?
 
umm, you can ping with an interface address ...

ping -i <ip address> <host to ping>

Jon
 
Tried already, but still didn't work. Use the -i option and then snoop the packet, found out Solaris still use primary ip address. I think the -i option is for multicast.
 
not necessarily ... it probably just thinks that it can use the first as it's primary interface ...

if you had netmasks set up, so that each ip was on a different subnet then it would probably work ...

i have 3 cards in my machine and i can ping -i <any interface> and get the host i want, but then again it's because of the routing. it uses the primary ip to route to the destination machine ... i guess you could look at the ifconfig -a ...

Jon
 
try using a different host name...create a file called hostname.<interface name> and enter the new hostname in there

example: /etc/hostname.hme0 10.x.x.x
/etc/hostname.hme:1 10.x.x.x


\Mike
 
try adding the second ip as the default route :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top