Computing.Net > Forums > Linux > Finding ip address in Linux

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Finding ip address in Linux

Reply to Message Icon

Name: zarkov
Date: December 13, 2001 at 08:08:02 Pacific
Comment:

Hello, I's sure this will seem silly, but how do you find you ip address in redhat linux 7.2? I know the command is called ifconfig but I don't know how to use it, despite having typed man ifconfig.



Sponsored Link
Ads by Google

Response Number 1
Name: regal
Date: December 13, 2001 at 10:21:30 Pacific
Reply:

you should be able to type 'ifconfig' or 'ifconfig -a' (all) and it will list the adapters and the ip's bound to them.


0

Response Number 2
Name: Zarkov
Date: December 14, 2001 at 14:36:11 Pacific
Reply:

What directory do you type this command in? I
get command not found


0

Response Number 3
Name: Daan van Kampen
Date: December 15, 2001 at 02:26:25 Pacific
Reply:

Try using the following command :

ip addr

it shows all ip adresses of your machines ip connections


0

Response Number 4
Name: Usman
Date: December 15, 2001 at 07:24:11 Pacific
Reply:

Hi guys,

I'm running Redhat 7.2.

HOw can i adjust stoping for tab character? Right now when i press tab key it jumps to 8 spaces to right i want to change it to 4. Thanks!

Usman.


0

Response Number 5
Name: Guy Allard
Date: December 15, 2001 at 17:04:39 Pacific
Reply:

To use ifconfig either:

1) Login as root, then issue:

ifconfig


2) Or as another user issue:

/sbin/ifconfig

Guy



0

Related Posts

See More



Response Number 6
Name: jharper
Date: December 22, 2001 at 13:19:42 Pacific
Reply:

netcfg&


0

Response Number 7
Name: DALI ILIAD
Date: January 10, 2002 at 03:37:27 Pacific
Reply:

for one, RH7.2 with kernel 2.4.7-10 uses different method to execute commands.

Try thie method.

*YOu don't need to login as root

cd /sbin
./ifconfig

or

cd /sbin
./ifconfig -a

~dali


0

Response Number 8
Name: sarath
Date: January 22, 2002 at 04:02:27 Pacific
Reply:

how to find ip addresses and MAC addresses of network neighbour hood of active machines in linux machines


0

Response Number 9
Name: Steve
Date: January 23, 2002 at 14:16:38 Pacific
Reply:

Heres a tricky one!
How do you get just the current IP address (DHCP Client) and only the ip address, none of the other stuff that comes with IFCONFIG.

What if you need to get it for scripts?
IE.
/sbin/ipchains -A input -d $MYDHCPIP -j DENY


0

Response Number 10
Name: Steve
Date: January 23, 2002 at 14:36:54 Pacific
Reply:

GOT IT!

/sbin/ifconfig | grep addr: | awk '{print $2}' | sed 's/addr\://'

Happy scripting!
Steve Barkey
sbarkey@alexin.ca


>Heres a tricky one!
>How do you get just the current IP address (DHCP Client) and only the ip address, none of the other stuff that comes with IFCONFIG.

>What if you need to get it for scripts?
>IE. /sbin/ipchains -A input -d $MYDHCPIP -j DENY


0

Response Number 11
Name: Alan
Date: February 25, 2002 at 06:50:48 Pacific
Reply:

Steve thanks for that syntax, it's almost exactly what I was looking for to display the current IP to the user during login. On my RedHat 7.1 system though it displays both the local IP and the localhost IP addresses.

Here's a modification I made which just looks at the first 'net card on the box (eth0).

/sbin/ifconfig -a eth0| grep addr: | awk '{print $2}' | sed 's/addr\://'

This works great from my .profile, thanks again. :)


0

Response Number 12
Name: Steve Barkey
Date: March 10, 2002 at 08:38:09 Pacific
Reply:

No Problem Alan
FYI: This little script works in FreeBSD, Solaris 8, and every Linux build I've tried.

Except in FreeBSD, its 'xl0' or 'rl0' :)


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Finding ip address in Linux

How do you release an IP address? www.computing.net/answers/linux/how-do-you-release-an-ip-address/6183.html

IP address & modem to get connected www.computing.net/answers/linux/ip-address-amp-modem-to-get-connected/5911.html

How to find disk info in Linux ? www.computing.net/answers/linux/how-to-find-disk-info-in-linux-/18739.html