ifconfig: command not found

10

3

I ssh into a remote machine with root which is installed with Fedora 18. I typed in

ifconfig

but I got

ifconfig: command not found

and also

     [root@kitch proxy]# /sbin/ifconfig
     -bash: /sbin/ifconfig: No such file or directory
    [root@kitch proxy]# sudo yum provides ifconfig
    fedora/filelists_db                                                                                                          |  25 MB  00:00:04
    updates/filelists_db                                                                                                         |  12 MB  00:00:02
    net-tools-2.0-0.2.20121106git.fc18.x86_64 : Basic networking tools
    Repo        : fedora
    Matched from:
    Filename    : /sbin/ifconfig

then I typed in ip link show

        [root@kitch proxy]# ip link show
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
        link/ether 00:1a:a0:23:86:6c brd ff:ff:ff:ff:ff:ff

and ip addr show

    t@kitch proxy]# ip addr show
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever
    2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
        link/ether 00:1a:a0:23:86:6c brd ff:ff:ff:ff:ff:ff
        inet 138.96.116.9/21 brd 138.96.119.255 scope global em1
        inet6 fe80::21a:a0ff:fe23:866c/64 scope link
           valid_lft forever preferred_lft forever

and

    [root@kitch proxy]# /sbin/iptables
    iptables v1.4.16.2: no command specified
    Try `iptables -h' or 'iptables --help' for more information.

there is no eth0 and the results are strange to me. Can anyone explain a bit?

misteryes

Posted 2013-04-11T14:19:39.290

Reputation: 2 255

Answers

6

Both Fedora and RedHat identify NICs that are embedded on the motherboard by emN instead of ethN.

EDIT: If you want to prevent uvdev from renaming eth0 to em1 check this:

http://comments.gmane.org/gmane.linux.redhat.fedora.general/421412

jmdana

Posted 2013-04-11T14:19:39.290

Reputation: 331

1but on many other fedora machines, they are ethN, why? besides, why ifconfig doesn't work? – misteryes – 2013-04-11T14:34:06.540

The other machines, do they have embedded NICs?

I'm not a Fedora user but try:

sudo yum provides ifconfig

In order to know which package installs ifconfig and install it. – jmdana – 2013-04-11T14:35:17.120

I tried, and updated the result, how to install? – misteryes – 2013-04-11T14:39:32.390

yum install net-tools I guess... – jmdana – 2013-04-11T14:41:25.960

@misteryes, it used to be called ethX until a short time back. The idea is to have stable device names (if you had e.g. two eth, which one was called eth0 depended on the random(ish) order in which they finished initialization). It will be called em0, the next one em1, always, even if it breaks etc. – vonbrand – 2013-04-11T17:17:34.177

11

ifconfig on Red Hat-esque boxes often lives in /sbin, which often isn't in the default path; try /sbin/ifconfig and see what you get.

The manual page for ip is a good place to start finding out about its options, behavior, output, &c.

Aaron Miller

Posted 2013-04-11T14:19:39.290

Reputation: 8 849

there is no iptables and /sin/ifconfig doesn't work – misteryes – 2013-04-11T14:26:52.163

1The ip command is slated to replace ifconfig, but way too many fingers know ifconfig to be able to delete it just now... – vonbrand – 2013-04-11T17:18:44.667

8

By default, ifconfig wont be there in RHEL.

sudo yum install net-tools

will instal ifconfig in /usr/sbin/ifconfig

user2216322

Posted 2013-04-11T14:19:39.290

Reputation: 81

This happens to be the most important answer here, it lets you know that you need to install net-tools; which is required unless you specific it upon OS install. – ZaxLofful – 2018-02-03T00:56:17.137