How do I get the IP address of my local unix box???


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How do I get the IP address of my local unix box???
# 1  
Old 04-04-2005
How do I get the IP address of my local unix box???

Hiya all,

How do I get the IP address of my local unix box???

IPconfig - don't exist
nslookup - only for other boxes....


I have my Fedora Server now on the office network. Can ping others, can get onto internet via web proxy....

Also:

How do I create a Drive Share, so our windows machines can view???


Please advise
Cheers
MArtin
Smilie
# 2  
Old 04-04-2005
You could try entering the following command:

netstat -in

, this will give you a table of information about all IP interfaces in your box. This will include the loopback interface (usually called lo0) which will have the address of 127.0.0.1, and then you will see the network interfaces (usually called eri0, eri1, etc. according to the number of network cards you have in your box).

be careful to distinguish between the "Net/Dest" IP address, and the actual IP address which is under the "Address" column (the "Address" column is right after the "Net/Dest" column so you will see two IP addresses next to each other, the one you desire is the second one.)
# 3  
Old 04-04-2005
use ... "ifconfig -a", disregard the lo0 output, and look at the ip address listed right after the word "inet" on the second line ...
Code:
hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
	inet 192.168.111.50 netmask ffffff00 broadcast 192.168.111.255
	ether 8:0:20:xx:xx:xx

or look for your box's name in /etc/hosts ...
Code:
root_mybox:/tmp # cat /etc/hosts
127.0.0.1	localhost	
192.168.111.50	mybox	loghost
192.168.111.80  myprinter
root_mybox:/tmp #

mybox has 192.168.111.50 as it's ip address
# 4  
Old 04-05-2005
Quote:
Originally Posted by marty 600
How do I create a Drive Share, so our windows machines can view???
Install and configure, Samba


"Samba is software that can be run on UNIX, Linux. Samba uses the TCP/IP protocol that is installed on the host server. When correctly configured, it allows that host to interact with a Microsoft Windows client or server as if it is a Windows file and print server."

If you are running GNU/Linux and Ms Windows on the same machine, you can create a partition, using the FAT32 filesystem, which can become a shared drive between both OS's.
# 5  
Old 04-05-2005
wow, thanks guys! Smilie

I'll give it a go in a bit! Smilie
# 6  
Old 04-07-2005
Quote:
Originally Posted by marty 600
Hiya all,

How do I get the IP address of my local unix box???

IPconfig - don't exist
nslookup - only for other boxes....

Smilie
Code:
nslookup `hostname`

# 7  
Old 04-08-2005
$/sbin/ifconfig `grep 'inet addr' | grep -v '127.0.0.0'`
had to struggle with this one a little! hope it helps
moxxx68..

Last edited by moxxx68; 04-08-2005 at 04:36 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

Can't get local IP address in getaddrinfo

Hi all, I am working with SIP protocol and am using SIPp to generate SIP traffic. But the call is not going through since I get the error; 2015-02-24 14:09:39:330 1424804979.330517: Can't get local IP address in getaddrinfo, local_host='NODE-01', local_ip=''. My ifconfig output is; ... (2 Replies)
Discussion started by: Junaid Subhani
2 Replies

2. Debian

How to change local IP address?

I have a new Ethernet device that has a default IP address on a different subnet and need to change it. I have a Debian 6.0 host connected to the device with a crossover cable and have changed the host /etc/hosts and /etc/networks files to the same subnet as the new device and rebooted. Ping... (2 Replies)
Discussion started by: snorkack59
2 Replies

3. IP Networking

How to know local IP address in X-Terminal?

Im using a X-Terminal in my windows pc to connect to a Linux server. Is there a way to know my local IP address in my x-terminal console? Here are few commands which didnt help me: ss_cc@MGTS5026-13sh1:~> finger Login Name Tty Idle Login Time Where loadhlr ... (6 Replies)
Discussion started by: Arun_Linux
6 Replies

4. Shell Programming and Scripting

Local system IP address in UNIX

We have requirement to get the local system IP address of whoever logined the DataBase(sqlplus) or any process in application server. Actually I connected to application server thru putty and then conencted to Database using sqlplus command. we have tried below commands : who -u|grep... (4 Replies)
Discussion started by: siri_886
4 Replies

5. Shell Programming and Scripting

ftp file starting with particular name on Windows box to Unix box using shell script

Hello all ! I'm trying to write a shell script (bash) to ftp a file starting with particular name like "Latest_" that is present on a Windows box to UNIX server. Basically I want to set this script in the cron so that daily the new build that is posted on the Windows box can be downloaded to the... (2 Replies)
Discussion started by: vijayb4u83
2 Replies

6. Shell Programming and Scripting

how to compare all files in one unix box has been to copied to another unix box

Hi our unix admin has copied all files from one unix box to new unix box. We just need to confirm that all the file systems are copied properly. How to validate. (9 Replies)
Discussion started by: sravanreddym
9 Replies

7. Linux

Local shell script need to be executed on a remote linux box

I need to execute a shell script on a remote linux box. But the shell script resides on the local linux box where I am currently logged in. Is there a way to do this? I know rsh <host> <command> can execute a command on the remote host. (6 Replies)
Discussion started by: rajeshomallur
6 Replies

8. UNIX for Dummies Questions & Answers

Running UNIX commands remotely in Windows box from Unix box – avoid entering password

I am able to run the UNIX commands in a Windows box from a UNIX box through "SSH" functionality. But whenever the SSH connection is established between UNIX and Windows, password for windows box is being asked. Is there a way to avoid asking password whenever the SSH connection is made? Can I... (1 Reply)
Discussion started by: D.kalpana
1 Replies

9. Shell Programming and Scripting

Easy way to get local IP address

I needed to get a machine's local IP address when not root (so no ifconfig). Eventually, I arrived at this convoluted solution that grabs the unique local IP info from netstat... netstat -n -t | awk '{print $4}' | grep -o "*\.*\.*\.*" |\ grep -v "127.0.0.1" | sort -u ...however I... (5 Replies)
Discussion started by: simonb
5 Replies

10. UNIX for Advanced & Expert Users

VPN client (windows Box),and Server (Unix Box)

If I want to access unix box via VPN tunnel,from windows box. What sould I configure on the windows client PC, and what should I enable on the Unix Server box ? I am using Solaris V10 intel platform, and I am using windows XP, and 2003 for client (0 Replies)
Discussion started by: zillah
0 Replies
Login or Register to Ask a Question