ifconfig:找不到命令

mis*_*yes 10 networking linux fedora

我通过 ssh 进入root安装了 Fedora 18的远程机器。我输入了

ifconfig
Run Code Online (Sandbox Code Playgroud)

但我得到了

ifconfig: command not found
Run Code Online (Sandbox Code Playgroud)

并且

     [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
Run Code Online (Sandbox Code Playgroud)

然后我输入 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
Run Code Online (Sandbox Code Playgroud)

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
Run Code Online (Sandbox Code Playgroud)

    [root@kitch proxy]# /sbin/iptables
    iptables v1.4.16.2: no command specified
    Try `iptables -h' or 'iptables --help' for more information.
Run Code Online (Sandbox Code Playgroud)

没有eth0,结果对我来说很奇怪。谁能解释一下?

Aar*_*ler 13

ifconfig在 Red Hat 式的 box 上通常位于 中/sbin,通常不在默认路径中;试试看/sbin/ifconfig你会得到什么。

该手册页ip是开始发现关于其选项,行为,输出,&C的好地方。


小智 8

默认情况下,ifconfig不会出现在 RHEL 中。

sudo yum install net-tools
Run Code Online (Sandbox Code Playgroud)

将安装ifconfig/usr/sbin/ifconfig


jmd*_*ana 6

双方的Fedora和RedHat标识由嵌入在主板上的网卡emN代替ethN

编辑:如果你想阻止 uvdev 将 eth0 重命名为 em1,请检查:

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