LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   no "ifconfig", how do I find out what IP address I was assigned? (https://www.linuxquestions.org/questions/fedora-35/no-ifconfig-how-do-i-find-out-what-ip-address-i-was-assigned-203575/)

clausawits 07-10-2004 10:00 PM

no "ifconfig", how do I find out what IP address I was assigned?
 
Sorry, a bit of a stupid question, but since "ifconfig" seems to not be present, how do I find out what IP address the DHCP server assigned me?

I tried going into hat|system settings|network, but it doesn't actually say what my IP is (least, not anywhere I could find it!).. kinda seems like it would be a good place to put it, no?

oh well.. thanks for any help.

druuna 07-10-2004 10:53 PM

Did you try netstat -n, you might want to set up an outside connection first (web, ftp, whatever).

Might give you a starting point to search the files (/etc ??) it could be stored in.

bluester 07-10-2004 11:08 PM

Actually ifconfig is installed on Fedora Core 2.
You have to do a"su -" to login is as superuser.
Just doing a "su" without the "-" will not give you access to it.
Do a "su -" and enter the root password when prompted.
Then type "if" and hit the tab key to display all executable files that start with "if"

I hope this helps!

pcardout 07-11-2004 04:40 AM

You don't need to su! This is another Linux path gotcha! The full command is

/sbin/ifconfig. /sbin/ is not in the default search path for users, but only for root. THAT's
why su'ing works. You can run this without su'ing if include the /sbin.

clausawits 07-11-2004 09:37 AM

Quote:

Originally posted by bluester
Actually ifconfig is installed on Fedora Core 2.
You have to do a"su -" to login is as superuser.
Just doing a "su" without the "-" will not give you access to it.
Do a "su -" and enter the root password when prompted.
Then type "if" and hit the tab key to display all executable files that start with "if"

I hope this helps!

Thanks! Now I need to look up what the heck "su -" does that's different from "su"... certainly just "su" doesn't work like it worked in other distributions...

I would still contend that the "Network" section of "System Settings" would be a convenient place in the gui maze (using gnome) to put the current IP address.

Thanks for the help! Off to learn what "su -" is...

edit: spelling and
"su -" just seems to be
-, -l, --login
make the shell a login shell
which doesn't make too much sense to me... I wonder what the distinction of being a "login shell" is-- running .profile and .bash type stuff? If so, I wonder if other distributions have "su" aliased to "su -" since just doing "su" in the past was enough to get ifconfig to work.

hmmm... thanks again..

carlosinfl 07-11-2004 12:52 PM

great question and answers - always wondered myself!

Just wondering - why is there a difference between su & su -?

archdev 07-11-2004 04:07 PM

when using su, the - following the command just inherits the environment of the subsitute user. without it, su root just gets your root but keeps your old enviroment settings

tkemp 02-26-2015 11:06 AM

UPDATE for new Linux Distros, i.e. RHEL7
 
I found tis thread looking for the same info, and after a little investigating found that net-tools have been deprecated in the newer Linux's. Passing this along in case others have the same question.

The ifconfig cmd has been replaced with ip. To list an grep the ip for an interface use this now, for example -

ip address | grep eth0 | awk '{ print $2 }'

Use ip --help or man ip for more info on the ip cmd.

raoulm 11-04-2016 03:26 PM

The best way (and the single one) that works for me was :
Code:

ip addr show


All times are GMT -5. The time now is 03:05 PM.