CentOS7最小化安装以后没有ifconfig这个命令的解决方案

后天小编最小化安装了弹指间CentOS7,进入系统发掘未有ifconfig那一个网络铺排专门的职业,又想急着上网,那怎么做呀。上面是本身付诸的消除方法:

1、用光驱配置yum源,安装net-tools那个软件包(或许用rpm那几个命令)。
   
1.1、把CentOS默许的yum源除(CentOS-Media.repo)都活动到三个点名的目录,小编是在yum源配置文件寄存目中国建工业总集结团了二个叫repo的子目录,以下是具体操作:
[root@bogon ~]# cd /etc/yum.repos.d/   
    [root@bogon yum.repos.d]# ls
    CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo 
CentOS-fasttrack.repo  CentO    S-Media.repo  CentOS-Sources.repo 
CentOS-Vault.repo
    [root@bogon yum.repos.d]# mkdir repo
    [root@bogon yum.repos.d]# ls
    CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo   
CentOS-Vault.repo
    CentOS-CR.repo    CentOS-fasttrack.repo  CentOS-Sources.repo  repo
    [root@bogon yum.repos.d]# mv *.repo repo/
    [root@bogon yum.repos.d]# ls
    repo
    [root@bogon yum.repos.d]# cd repo/
    [root@bogon repo]# ls
    CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo 
CentOS-fasttrack.repo  CentO    S-Media.repo  CentOS-Sources.repo 
CentOS-Vault.repo
    [root@bogon repo]# mv CentOS-Media.repo ../
    [root@bogon repo]# ls
    CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo 
CentOS-fasttrack.repo  CentO    S-Sources.repo  CentOS-Vault.repo
    [root@bogon repo]# cd ..
    [root@bogon yum.repos.d]# ls
    CentOS-Media.repo  repo

      1.2、挂载光驱配置yum源的具体操作步骤:

[root@bogon yum.repos.d]# mount /dev/sr0 /media/   
    mount: /dev/sr0 is write-protected, mounting read-only
    #以上是挂载光驱的吩咐和操作步骤
     
    [root@bogon yum.repos.d]# cat CentOS-Media.repo 
    [c7-media]
    name=CentOS-$releasever – Media
    baseurl=file:///media/
    gpgcheck=1
    enabled=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 
    #上述光驱yum源的陈设文书档案
     
    [root@bogon yum.repos.d]# yum list | wc -l
    3776
    #用yum list查看测量试验yum源是或不是存在难点

    1.3、用yum安装net-tools工具包
[root@bogon yum.repos.d]# yum install net-tools -y   
    Loaded plugins: fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
    Resolving Dependencies
    –> Running transaction check
    —> Package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be
installed
    –> Finished Dependency Resolution
    …………
    Running transaction
      Installing : net-tools-2.0-0.17.20131004git.el7.x86_64           
                                                                     
1/1
      Verifying  : net-tools-2.0-0.17.20131004git.el7.x86_64           
                                                                     
1/1
    Installed:
      net-tools.x86_64 0:2.0-0.17.20131004git.el7                     
                                                                       
   
    Complete!

    1.4、测试ifconfig命令 
[root@bogon yum.repos.d]# ifconfig
    eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu
1500
            inet 192.168.1.131  netmask 255.255.255.0  broadcast
192.168.1.255
            inet6 fe80::20c:29ff:fe2d:c130  prefixlen 64  scopeid
0x20<link>
            ether 00:0c:29:2d:c1:30  txqueuelen 1000  (Ethernet)
            RX packets 53366  bytes 3890372 (3.7 MiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 47832  bytes 22949340 (21.8 MiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
     
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
永利澳门游戏网站,            loop  txqueuelen 0  (Local Loopback)
            RX packets 58  bytes 5088 (4.9 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 58  bytes 5088 (4.9 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

2、在linux中除去ifconfig这些命令能够配备IP地址之外还会有八个限令正是ip了(自个儿用的是这种方法)。
[root@bogon yum.repos.d]# ip addr l eno16777736
    2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
qdisc pfifo_fast state UP qlen 1000
        link/ether 00:0c:29:2d:c1:30 brd ff:ff:ff:ff:ff:ff
        inet 192.168.1.131/24 brd 192.168.1.255 scope global
eno16777736
          valid_lft forever preferred_lft forever
        inet6 fe80::20c:29ff:fe2d:c130/64 scope link 
          valid_lft forever preferred_lft forever
    [root@bogon yum.repos.d]# ip addr add 192.168.1.131/24 dev
eno16777736

ip这一个命令和博雅不是一两句话就能够证实的,在之后网络学习的时候作者会给我们举办详细认真的疏解,再给大家提一下有关网卡,在CentOS7过后暗中认可的网卡类型标志符为eno16777736,在原先的系统为ethN。

正文恒久更新链接地址:http://www.linuxidc.com/Linux/2016-03/129302.htm

永利澳门游戏网站 1

发表评论

电子邮件地址不会被公开。 必填项已用*标注