LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   command to find ip address in a local network (https://www.linuxquestions.org/questions/linux-newbie-8/command-to-find-ip-address-in-a-local-network-608101/)

babu198649 12-20-2007 07:34 AM

command to find ip address in a local network
 
hi
what is the command to find the ip address of my system .

bsdunix 12-20-2007 08:06 AM

Code:

# ifconfig
Read man ifconfig for options.

hasanatizaz 12-20-2007 02:17 PM

ifconfig -a

bbfuller 12-20-2007 02:45 PM

I gather that the command ifconfig is now deprecated and in at least some distributions its replacement is installed as well.

The new command is ip followed by a switch.

Code:

ip addr
gives a similar output to ifconfig.

The other switches are available in:

Code:

man ip
Code:

ip neigh
is very useful to see what else is running on your network.

LinuxCrayon 12-21-2007 12:07 AM

Also, it should be noted that at least on Fedora, both of those reside in /sbin/, which is not part of a normal user's path (as it contains tools meant for root, or so that is my understanding) and so the user will need to add /sbin/ to their PATH or they will need to type

Code:

$ /sbin/ifconfig
or

Code:

$ /sbin/ip addr
In my situation, as a default new user, it is NOT necessary to be root to access these two particular commands.

babu198649 12-21-2007 07:35 AM

thank u linuxCrayon

u r right . typing with the path name(/sbin/) only worked .

onebuck 12-21-2007 07:56 AM

Hi,

Quote:

Originally Posted by bbfuller (Post 2997351)
I gather that the command ifconfig is now deprecated and in at least some distributions its replacement is installed as well.

The new command is ip followed by a switch.

Code:

ip addr
gives a similar output to ifconfig.

The other switches are available in:

Code:

man ip
Code:

ip neigh
is very useful to see what else is running on your network.

You should read the 'man' that you are referencing.

I would like to clarify the above;

Quote:

excerpt from 'man ifconfig'

IFCONFIG(8) Linux Programmer's Manual IFCONFIG(8)

NAME
ifconfig - configure a network interface


Quote:

excerpt from 'man ip'
IP(8) Linux IP(8)

NAME
ip - show / manipulate routing, devices, policy routing and tunnels

The two commands are used for different actions. No deprecation!

onebuck 12-21-2007 08:11 AM

Hi,

Quote:

Originally Posted by LinuxCrayon (Post 2997750)
Also, it should be noted that at least on Fedora, both of those reside in /sbin/, which is not part of a normal user's path (as it contains tools meant for root, or so that is my understanding) and so the user will need to add /sbin/ to their PATH or they will need to type

Code:

$ /sbin/ifconfig
or

Code:

$ /sbin/ip addr
In my situation, as a default new user, it is NOT necessary to be root to access these two particular commands.

The '/sbin' is not included in the normal user path to prevent the average user from damaging the system. The root or superuser account should be treated with respect so as not to cause undo able damage. I agree that a user can use the absolute path to get to a command but that can also create the same.

Quote:

Originally Posted by LinuxCrayon (Post 2997750)
In my situation, as a default new user, it is NOT necessary to be root to access these two particular commands.

You probably modified the user profile or path.

LinuxCrayon 12-21-2007 02:07 PM

Hello again, Onebuck. :)

Nope. Haven't modified it at all. In fact, even without being root, I can shutdown the system...do all kinds of stuff that I probably should not be able to do. I've found this to be true of Fedora and OpenSUSE. Note that this is with the default new account set up during installation...and I haven't tested that with any newly created users. Apparently the OP found the same to be true.

As a side note, I should probably remove permission to /sbin...

onebuck 12-22-2007 07:09 AM

Hi,

Quote:

Originally Posted by LinuxCrayon (Post 2998292)
Hello again, Onebuck. :)

Nope. Haven't modified it at all. In fact, even without being root, I can shutdown the system...do all kinds of stuff that I probably should not be able to do. I've found this to be true of Fedora and OpenSUSE. Note that this is with the default new account set up during installation...and I haven't tested that with any newly created users. Apparently the OP found the same to be true.

As a side note, I should probably remove permission to /sbin...

I would most certainly do this for any system that will have multiple users on. Especially for any server you may want to setup.


All times are GMT -5. The time now is 08:48 AM.