0

When I check ifconfig -a command on Solaris 10, I get a list of interfaces configured. However my requirement is, I need the interface name on which my system address is configured. Ex. my IP is 1.2.3.4 How can I check if on which interface this Ip is configred. Also I dont have an Ip address of system. I just need to find interface on which system Ip is configured.

Thanks in avance

1 Answers1

0

One way to go about this is to examine your /etc/hostname.interface files. One of these will contain the hostname. You may only have one, but if you are using IPMP you'll have others and if you're on multiple networks you'll have more.

Example of a solaris 10 host with an IPMP pair for the front-end and an IPMP pair for the back-end:

#ls -C1 /etc/hostname.*     
/etc/hostname.e1000g0
/etc/hostname.e1000g1
/etc/hostname.e1000g2
/etc/hostname.e1000g3

#cat /etc/hostname.*

myhostname netmask + broadcast + group ipmp_fe up
group ipmp_fe up
myhostname-nfs netmask + broadcast + group ipmp_be up
group ipmp_be up

Each interface with an IP address will have a hostname in the corresponding /etc/hostname.interface file which corresponds to an entry in /etc/hosts. A simple shell script can parse this out for you. In the example above, this host is using IPMP so you have 2 extra files which do not contain the hostname.

There are other ways to configure solaris networking but the above is how it's been done for a long time and likely how it's done on your system.

BenH
  • 690
  • 1
  • 11
  • 23