IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Remove “Determining if ip address (^([0-9]{1,3}\\.){3,3}[0-9]{1,3}$) is already in use for device (^[a-zA-Z0-9]+$)…”

    ★Extreme★发表于 2015-08-24 10:50:53
    love 0

    Have you ever bind a large of ip address for your CentOS?

    If your answer is yes, you must have seen some informations like this:

    Determining

     

    What a anti-human decision to determining a large of ip address in use on boot.

    In CentOS, /etc/init.d/network run ifup to bring up your interface, fortunately, ifup is not a binary file but a shell script, so we have a chance to remove this anti-human function.

    Change dir to /etc/sysconfig/network-scripts/ and run ls, we can see several ifup script:

    ifup
    ifup-aliases
    ifup-bnep
    ifup-eth
    ifup-ippp
    ifup-ipv6
    ifup-ippp
    ifup-plip
    ifup-plusb
    ifup-post
    ifup-ppp
    ifup-routes
    ifup-sit
    ifup-tunnel
    ifup-wireles

    We use grep to search key words "Determing if":

    grep "Determining if" ./ -nir

    Results:

    ./ifup-eth:244:				echo $"Determining if ip address ${ipaddr[$idx]} is already in use for device ${REALDEVICE}..."
    ./ifup-aliases:265:                   echo $"Determining if ip address ${IPADDR} is already in use for device ${parent_device}..."

    We need to modify both ifup-eth and ifup-aliases files so as to clean this function.

    Open ifup-eth, go to 244 line, we can see some code like this:

    Code

    ifup uses arping to know whether there a  MAC address is using the ip address is going to bind for this host.

    ARP packages are broadcast packages, aftering send a arp package to determining ip in use, arping need to wait for a reply broadcast package.

    When there is a host using that ip, arping can get that reply package quickly, but if not, arping need to wait for several seconds so as to confirm no host is using the ip address.

    Let's comment these code:

    Comment

    Do the same thing for ifup-aliases.

    Now the "Determing if" does not show on boot anymore.



沪ICP备19023445号-2号
友情链接