Centos7多余1个IP地址

问题描述

配置了Centos7的网络配置文件,制定了一个IP:192.168.1.221,但是

[root@bogon bin]# ip add 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp24s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:d8:61:30:81:b3 brd ff:ff:ff:ff:ff:ff inet 192.168.1.100/24 brd 192.168.1.255 scope global noprefixroute dynamic enp24s0 valid_lft 49736sec preferred_lft 49736sec inet 192.168.1.221/24 brd 192.168.1.255 scope global secondary noprefixroute enp24s0 valid_lft forever preferred_lft forever inet6 fe80::a584:7c00:659a:80fd/64 scope link noprefixroute valid_lft forever preferred_lft forever

查看有多余的ip: inet 192.168.1.100/24
分析原因

百度一圈找到Centos配置多个IP的教程,但是反复看了几篇,翻阅到一篇提到配置静态IP,灵机一动,难道我们多的IP是DHCP指认出来的.后来查看配置文件,确实配置的是DHCP模式,修改为static就解决问题了.
修改历程
查找对应的配置文件

配置文件名后缀为可以查看刚才的ip add的显示两个ip(意外的ip100和配置过的ip221)的数字冒号后的内容,本例是2:后的内容内容,即enp24s0

 enp24s0: <BROADCAST,MULTICAST,UP,LOWER_UP>....略...

编辑配置文件

文件路径为:/etc/sysconfig/network-scripts/
文件前缀一般为:ifcfg-

vi /etc/sysconfig/network-scripts/ifcfg-enp24s0

找到下面这个key值BOOTPROTO,把value dhcp修改为static

#修改前   BOOTPROTO="dhcp"
#修改后   BOOTPROTO="static"

重启网络

输入命令service network restart重启,看到OK

service network restart
Restarting network (via systemctl):  

确认效果,再次 ip add查看可以看到只有我们只认的一个IP221了.

[root@bogon bin]# ip add 1: lo: 略 2: enp24s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:d8:61:30:81:b3 brd ff:ff:ff:ff:ff:ff inet 192.168.1.221/24 brd 192.168.1.255 scope global noprefixroute enp24s0 valid_lft forever preferred_lft forever inet6 fe80::a584:7c00:659a:80fd/64 scope link noprefixroute valid_lft forever preferred_lft forever
原文链接:,转发请注明来源!

发表评论

要发表评论,您必须先登录

  • 92 Responses to “Centos7多余1个IP地址”
    • best online international pharmacies

      <a href="http://canadianonlinepharmacykkr.com/">reputable online pharmacy</a>
      http://canadianonlinepharmacykkr.com/
      <a href=http://canadianonlinepharmacykkr.com/>top 10 online pharmacies</a>

    • canadian pharmacy online

      <a href="http://canadianfastpharmacy.com/">safe canadian pharmacies online</a>
      http://canadianfastpharmacy.com/
      <a href=http://canadianfastpharmacy.com/>mail order prescription drugs from canada</a>

    • Lioysbm

      scientific name viagra joke how much is the penalty for no health insurance for 2017 can i take two 50mg viagra at one time <a href="https://himsprescription.com/#">online viagra without subscription</a> - how long does it take cialis to kick in https://himsprescription.com/# - cialis 20 vs 10 coffee and arthritis

    • Eraidssut

      penis discoloration from vacuum devices for erectile dysfunction <a href=https://withouthims.com>viagra without doctor visit</a> sildenafil side effect
      colon cancer and erectile dysfunction: https://withouthims.com canada viagra without a doctor prescriptions

    • list of legitimate canadian pharmacies

      <a href="http://canadianpharmacynethd.com/">pharmacy in canada</a>
      http://canadianpharmacynethd.com/
      <a href=http://canadianpharmacynethd.com/>top rated canadian pharmacies online</a>

    • canada drugs online reviews

      <a href="http://canadianfastpharmacy.com/">canada pharmacies online</a>
      http://canadianfastpharmacy.com/
      <a href=http://canadianfastpharmacy.com/>mexican pharmacies shipping to usa</a>

    • online canadian pharmacy

      <a href="http://canadiannextpharmacy.com/">approved canadian pharmacies online</a>
      http://canadiannextpharmacy.com/
      <a href=http://canadiannextpharmacy.com/>list of reputable canadian pharmacies</a>

    • canadian pharmacies

      <a href="http://canadianpharmacynethd.com/">canada drug</a>
      http://canadianpharmacynethd.com/
      <a href=http://canadianpharmacynethd.com/>canada pharmacies online prescriptions</a>

    • mexican border pharmacies

      <a href="http://canadiannextpharmacy.com/">reliable mexican pharmacies</a>
      http://canadiannextpharmacy.com/
      <a href=http://canadiannextpharmacy.com/>safe online pharmacies</a>

    • most trusted canadian online pharmacies

      <a href="http://canadianpharmacieselite.com/">most reliable canadian pharmacies</a>
      http://canadianpharmacieselite.com/
      <a href=http://canadianpharmacieselite.com/>online pharmacies legitimate</a>

    • Esqu36x

      arthritis foods to avoid 10 mg cialis per day
      <a href="https://withoutshort.com">sildenafil</a> Uexqxpvx
      https://withoutshort.com buy viagra

    • online pharmacies of canada

      <a href="http://canadianpharmacieselite.com/">best online canadian pharmacy</a>
      http://canadianpharmacieselite.com/
      <a href=http://canadianpharmacieselite.com/>overseas pharmacy</a>

    • best online international pharmacies

      <a href="http://canadianonlinepharmacynote.com/">best 10 online canadian pharmacies</a>
      http://canadianonlinepharmacynote.com/
      <a href=http://canadianonlinepharmacynote.com/>canada pharmacy</a>

    • ADwene

      <a href=http://www.withoutscript.com>cialis online</a> http://www.doctorborat.com

    • overseas online pharmacies

      <a href="http://canadianonlinepharmacynote.com/">overseas online pharmacy</a>
      http://canadianonlinepharmacynote.com/
      <a href=http://canadianonlinepharmacynote.com/>canadian internet pharmacy</a>

    • online pharmacies canada

      <a href="http://canadianpharmacyhopemeds.com/">international pharmacies that ship to the usa</a>
      http://canadianpharmacyhopemeds.com/
      <a href=http://canadianpharmacyhopemeds.com/>online pharmacy reviews</a>

    • highest rated canadian pharmacies

      <a href="http://canadianpharmacyhopemeds.com/">legitimate canadian pharmacy online</a>
      http://canadianpharmacyhopemeds.com/
      <a href=http://canadianpharmacyhopemeds.com/>list of reputable canadian pharmacies</a>

    • most reliable canadian pharmacies

      <a href="http://canadianonlinepharmacykkr.com/">mexican pharmacies online</a>
      http://canadianonlinepharmacykkr.com/
      <a href=http://canadianonlinepharmacykkr.com/>canadian pharcharmy online</a>

    • international pharmacy

      <a href="http://canadianonlinepharmacykkr.com/">legitimate canadian pharmacies online</a>
      http://canadianonlinepharmacykkr.com/
      <a href=http://canadianonlinepharmacykkr.com/>canadian pharmacies online reviews</a>

    • trust pharmacy canada

      <a href="http://canadianbestpharmacyonline.com/">best online canadian pharmacy</a>
      http://canadianbestpharmacyonline.com/
      <a href=http://canadianbestpharmacyonline.com/>canada pharmacy</a>

    • overseas pharmacies online

      <a href="http://canadianbestpharmacyonline.com/">best canadian mail order pharmacies</a>
      http://canadianbestpharmacyonline.com/
      <a href=http://canadianbestpharmacyonline.com/>reputable canadian online pharmacies</a>

    • Ycmdfgk

      viagra price euro how do hearing aids help if the brain can't decipher how can you get viagra over the counter <a href="https://viawithoutdctrs.com/#">viagra without a doctors approval</a> - arginine et cialis https://viawithoutdctrs.com/# - viagra cialis levitra pret what are the types of arthritis

    • Ybqbgbpn

      first aid for poisoning como funciona mejor el cialis
      <a href="https://kamagrajellynow.com">kamagra oral jelly</a> Ldktsmy
      https://kamagrajellynow.com kamagra jelly

    • EDwene

      <a href=http://www.ycialisy.com>viagra generic</a> http://www.doctorkiva.com

    • Eitic20

      cheap canadian cialis food for high blood pressure taking cialis full stomach <a href="https://tadalafilkiva.com/#">tadalafil</a> - cialis recreationally https://tadalafilkiva.com/# - combinar priligy cialis beets and blood pressure

    • canadian trust pharmacy

      <a href="http://canadianpharmacyhub.com/">canadian pharmacies online reviews</a>
      http://canadianpharmacyhub.com/
      <a href=http://canadianpharmacyhub.com/>reliable mexican pharmacies</a>

    • EDwene

      <a href=http://www.canadianvolk.com>levitra daily use</a> http://www.viagwithoutdr.com

    • mexican pharmacies

      <a href="http://canadianpharmacyhub.com/">canada online pharmacies</a>
      http://canadianpharmacyhub.com/
      <a href=http://canadianpharmacyhub.com/>highest rated canadian pharmacies</a>

    • canadian pharmacies online

      <a href="http://canadianpharmacyguru.com/">safe online pharmacies</a>
      http://canadianpharmacyguru.com/
      <a href=http://canadianpharmacyguru.com/>canadian online pharmacies legitimate</a>

    • Iamburce

      Very good knowledge. With thanks. <a href=https://www.goldkamagra.com>kamagra</a> kamagra pills
      quickly does kamagra work: https://www.goldkamagra.com kamagra online

    • most trusted canadian online pharmacies

      <a href="http://canadianpharmacyguru.com/">mexican pharmacies online cheap</a>
      http://canadianpharmacyguru.com/
      <a href=http://canadianpharmacyguru.com/>canadian pharmacy online</a>

    • canadian pharmaceuticals online

      <a href="http://canadianpharmacyfit.com/">mexican online pharmacies</a>
      http://canadianpharmacyfit.com/
      <a href=http://canadianpharmacyfit.com/>highest rated canadian pharmacies</a>

    • ZesPseupE

      non skid shoes for wet areas hats raffia <a href=http://www.222book222.com>adelboden ski shirts </a>
      parbo shirt gilt edge for shoes <a href="http://www.452href.com"> norweigian dress </a>
      ventelated mexican peasant shirt misses purple button down shirts http://www.udwcs1223.com vintage 50s dresses

    • top rated canadian online pharmacy

      <a href="http://canadianpharmacyfit.com/">my canadian pharmacy</a>
      http://canadianpharmacyfit.com/
      <a href=http://canadianpharmacyfit.com/>canada pharmacies online prescriptions</a>

    • legitimate canadian pharmacy

      <a href="http://canadianpharmacycenterhd.com/">mexican pharmacies online</a>
      http://canadianpharmacycenterhd.com/
      <a href=http://canadianpharmacycenterhd.com/>legitimate online pharmacies india</a>

    • Idsjtii

      cialis buy in canada kamagra bestellen illegal
      Eljnr16 <a href="https://kamagrajellynow.com">kamagra</a>
      https://kamagrajellynow.com kamagra 100 mg oral jelly

    • canadian online pharmacies ratings

      <a href="http://canadianpharmacyhub.com/">reputable mexican pharmacies online</a>
      http://canadianpharmacyhub.com/
      <a href=http://canadianpharmacyhub.com/>online pharmacies of canada</a>

    • mail order prescription drugs from canada

      <a href="http://canadianpharmacycenterhd.com/">canadian online pharmacies ratings</a>
      http://canadianpharmacycenterhd.com/
      <a href=http://canadianpharmacycenterhd.com/>online pharmacy canada</a>

    • online canadian pharmacy

      <a href="http://canadianpharmaciespreshd.com/">legitimate canadian pharmacy online</a>
      http://canadianpharmaciespreshd.com/
      <a href=http://canadianpharmaciespreshd.com/>online pharmacy</a>

    • online pharmacies of canada

      <a href="http://canadianpharmacyguru.com/">certified canadian online pharmacies</a>
      http://canadianpharmacyguru.com/
      <a href=http://canadianpharmacyguru.com/>mexican border pharmacies</a>

    • online pharmacy

      <a href="http://canadianpharmaciespreshd.com/">legitimate online pharmacies</a>
      http://canadianpharmaciespreshd.com/
      <a href=http://canadianpharmaciespreshd.com/>online pharmacy reviews</a>

    • most trusted canadian pharmacy

      <a href="http://canadianpharmacieshq.com/">list of legitimate canadian pharmacies</a>
      http://canadianpharmacieshq.com/
      <a href=http://canadianpharmacieshq.com/>best 10 online canadian pharmacies</a>