How can i get Solaris interface ip using shell script?


 
Thread Tools Search this Thread
Operating Systems Solaris How can i get Solaris interface ip using shell script?
# 1  
Old 05-11-2015
How can i get Solaris interface ip using shell script?

HI Community,

my server has more than 15 zones and each one is having virtual interface of 10G adapter (qlge0)

if the filter the output of ifconfig -a | grep inet, it's showing all interfaces including virtual.

i have take first like from the output and assumed that as my main ip

is there any other way to get ip address from shell?

Regards,
Ben
# 2  
Old 05-12-2015
nslookup zone_name will give you what you want.
If you are logged in to the global zone:

Code:
zoneadm list -civ

shows the names of all of the zones.

I had trouble understanding what you need, exactly. If this is not it, please let us know.
# 3  
Old 05-12-2015
This might be what you are looking for :
Code:
ifconfig -a4 | nawk '
    BEGIN { ignore=0 }
    /zone/ { ignore=1 }
    /inet/ { if((ignore==0) && ($2!="127.0.0.1") && ($2!="0.0.0.0")) print $2 ; ignore=0}'

This User Gave Thanks to jlliagre For This Post:
# 4  
Old 06-02-2015
Wow

thanks for your help. it worked for me
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Web Interface for shell script.

Hi Team, I have daily pdf files which i have to convert in tif images. I have script which does it. I need to put these images in some specific folder (which i create manually) on server. Is there any web based way to it, so that user can simply browse file & it will convert & upload on... (1 Reply)
Discussion started by: paragnehete
1 Replies

2. Shell Programming and Scripting

Shell script trigger using http interface

Hi I have created a shell program, which takes a series of parameters as shown in the below code. Its working good from terminal. My program restorejob.sh -g <NAME> -p <Path-to-search> -r <Path-to-restore> Its working fine from bash shell. I want to extend this functionality like... (1 Reply)
Discussion started by: rakeshkumar
1 Replies

3. Solaris

Network Interface -- Solaris

Dear All, I have a solaris Server in which I have 4 network interfaces , out of which only one is used . So all the applications are using this interface . The interface speed is 1000Mbps . I find no hardware issue or packets g being dropped. But i find that no of Input and Output... (4 Replies)
Discussion started by: jegaraman
4 Replies

4. AIX

Same shell script does not working on same server but from different interface..why?

Hi , I have shell script which is perfectly working on unix server prompt. But when i execute it using maestro scheduler with same user , it is giving error of not recognizing the env or local variable. This is code in script inbDir=${INTRFACE_DIR}/inbound zipfile=$inbDir/$1 echo... (2 Replies)
Discussion started by: avi.coep
2 Replies

5. Shell Programming and Scripting

User interface for the shell script

Hi, I have written a shell script that does the job of downloading a build file and upgrading a application on my test linux system. This shell is a interactive script where the user needs to enter certain info like the remote system on which the upgrade has to be performed and the build number... (2 Replies)
Discussion started by: sunrexstar
2 Replies

6. Solaris

Command line Interface or GUI Interface not shown on solaris

Dear all, I am a newbie in solaris and I need your advice. I have a Solaris version 5.9 installed on Sunfire V240. I am able to ssh the machine from putty remotely. My problem is that I cannot see the display from KVM switch I have connected to it. I need also to be able to see the GUI... (2 Replies)
Discussion started by: mbouster
2 Replies

7. Solaris

sppp0 interface in solaris 10

What is sppp0 interface in solaris 10 and how can we disable it ? (1 Reply)
Discussion started by: fugitive
1 Replies

8. Shell Programming and Scripting

navigating a web interface with a shell script

I'm trying to design a script that will check the external ip address of my home network and then assign it to the A record of a subdomain. When i started, i thought i could do this with SSH, but turns out I don't have ssh access to update the DNS record (not surprising i suppose) So now, i... (2 Replies)
Discussion started by: boyincity
2 Replies

9. IP Networking

Activating an interface on a Solaris 10

Help! How do I get (configure) an inteface up in order to get access to the internet? System in use is SPARC Ultra 5 - it worked before but not now when I re-installed the system and forgot to connect the RJ45 cable to the interface. (3 Replies)
Discussion started by: Maen
3 Replies

10. UNIX for Dummies Questions & Answers

Adding an interface to solaris?

I have a quad ethernet card in my sun box, and only 3 of them are visable when I "ifconfig -a". How do I activate the the 4th one? I think it is solaris 5.6. Thanks. Marc (1 Reply)
Discussion started by: mmaniscalco
1 Replies
Login or Register to Ask a Question