[ug-bosug] Zone Host name command

Ananth Shrinivas Ananth.Shrinivas at Sun.COM
Wed Jul 18 06:35:54 PDT 2007


If you don't want to write a script to parse ifconfig output, libdevinfo 
(3LIB) is what you are looking for.
Read the man

or take a look at this:

http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c#1770

Cheers,
Ananth

srikanth kshatriy wrote:
>
> Hi ananth,
>
> To configure a zone, we need to know network interface.
> ifconfig  -a will show many other details also  along with network 
> interface.
> I just want to  know is there any other specific command which can give
> list only the network interfaces.
>
>
>
>
> On 7/18/07, *Ananth Shrinivas* <Ananth.Shrinivas at sun.com 
> <mailto:Ananth.Shrinivas at sun.com> > wrote:
>
>     srikanth kshatriy wrote:
>     > Hi ananth,
>     >
>     > On 7/18/07, *Ananth Shrinivas* < Ananth.Shrinivas at sun.com
>     <mailto:Ananth.Shrinivas at sun.com>
>     > <mailto:Ananth.Shrinivas at sun.com
>     <mailto:Ananth.Shrinivas at sun.com>>> wrote:
>     >
>     >     srikanth kshatriy wrote:
>     >     > Hello..
>     >     >
>     >     >
>     >     > 1) What is the command to get the host name of the zone?
>     >     >
>     >     > * zlogin <zone name> uname -n * command works for only
>     running
>     >     zones.
>     >     > If its in the
>     >     > configured or installed state how to get that??
>     >     zoneadm list -p <ZONENAME> | nawk -F ':' '{print "cat
>     >     $4/etc/hostname.*"}' | bash
>     >
>     >
>     >
>     >  This command is giving the list of all existing zone's host names.
>     >   I need the host name of a particular zone.
>     >   Is there any way to grep it?
>
>     Sorry. Mistyped the command
>     zoneadm -z myzone  list -p | nawk -F ':' '{print "cat " $4
>     "/etc/hostname.*"}'  | bash
>
>     >
>     >
>     >
>     >     >
>     >     >
>     >     > 2) Is there any specific command to get the only network
>     interface??
>     >
>     >
>     >
>     >    Inside a running zone or outside of it ?
>     >
>     >    I want to list all the network interfaces existing in the system.
>     >
>     >    I need these two for my project. So please help..
>
>     ifconfig doesn't help ?
>
>     You could explain in a little more detail what you are trying to do so
>     that people can help you with more "insightful" answers.
>
>     Cheers,
>     Ananth
>
>     _______________________________________________
>     ug-bosug mailing list
>     List-Unsubscribe: mailto:ug-bosug-unsubscribe at opensolaris.org
>     <mailto:ug-bosug-unsubscribe at opensolaris.org>
>     List-Owner: mailto:ug-bosug-owner at opensolaris.org
>     <mailto:ug-bosug-owner at opensolaris.org>
>     List-Archives: http://www.opensolaris.org/jive/forum.jspa?forumID=54
>
>
>
>
> -- 
> Think beyond the limit...
>                           Srikanth.
> ------------------------------------------------------------------------
>
> _______________________________________________
> ug-bosug mailing list
> List-Unsubscribe: mailto:ug-bosug-unsubscribe at opensolaris.org
> List-Owner: mailto:ug-bosug-owner at opensolaris.org
> List-Archives: http://www.opensolaris.org/jive/forum.jspa?forumID=54
>   



More information about the ug-bosug mailing list