RHEL/CentOSã§ãããã¯ã¼ã¯ã¤ã³ã¿ãã§ã¼ã¹ã®èµ·åãé ãåå ã調ã¹ã¦ã¿ã
RHELãCentOSã®ãããã¯ã¼ã¯ã¤ã³ã¿ãã§ã¼ã¹ã£ã¦éçIPã¢ãã¬ã¹ãä»ä¸ããã¨ãã§ããããèµ·åãé
ããªãã§ããã
ãããã¯ã¼ã¯ã¤ã³ã¿ãã§ã¼ã¹ã2,3åç¨åº¦ãªã大ããåé¡ã§ã¯ãªãã®ã§ãããä¾ãã°VLANãããããé£ããã¦ããå ´åãªã©ã¯ãããé
ãã¦è©±ã«ãªããã¬ãã«ã§ãã
Bringing up loopback interface: [ OK ] âloã¯æ©ã Bringing up interface eth0: [ OK ] âé ã Bringing up interface eth0.1: [ OK ] âVLANãé ã Bringing up interface eth0.2: [ OK ] âé ãã Bringing up interface eth0.3: [ OK ] âé ãã£ã¦ã°
ifupã³ãã³ãã§ãããæéã確èªããã¨ããã1ãããã¯ã¼ã¯ã¤ã³ã¿ãã§ã¼ã¹ãããç´5ç§ããããã¯ã¼ã¯ã¤ã³ã¿ãã§ã¼ã¹ã20åããã¨ããã ãã§1å40ç§ãããè¨ç®ãã¾ãããã
# ifdown eth0 # time ifup eth0 real 0m5.029s user 0m0.285s sys 0m0.610s
ãããã¯ã¼ã¯ã¤ã³ã¿ãã§ã¼ã¹ã®èµ·åã¹ã¯ãªããã追ã£ãã¨ããã/etc/sysconfig/network-scripts/ifup-ethã®ä»¥ä¸ã®é¨åãåå ã§ãããCentOS6ã¯253è¡ãã257è¡ããããCentOS5ã¯267è¡ãã270è¡ãããã
# vi /etc/sysconfig/network-scripts/ifup-eth ... [ "${REALDEVICE}" != "lo" ] && \ if ! /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${ipaddr[$idx]} ; then net_log $"Error, some other host already uses address ${ipaddr[$idx]}." exit 1 fi
ãã®arpingã§ç´4ç§å¾ æ©ãã¦ãï¼ï¼ãªããããããã
arpingã«ã¤ãã¦
arpingã¯ARPãªã¯ã¨ã¹ããéä¿¡ããã³ãã³ãã§ã-Dãªãã·ã§ã³ã¯éè¤ãã§ãã¯ãè¡ããªãã·ã§ã³ã
$ man arping ARPING(8) System Managerâs Manual: iputils ARPING(8) NAME arping - send ARP REQUEST to a neighbour host SYNOPSIS arping [ -AbDfhqUV] [ -c count] [ -w deadline] [ -s source] -I inter- face destination DESCRIPTION Ping destination on device interface by ARP packets, using source address source. OPTIONS ï¼ä¸ç¥ï¼ -D Duplicate address detection mode (DAD). See RFC2131, 4.4.1. Returns 0, if DAD succeeded i.e. no replies are received
è¨å®ãããã¨ããIPã¢ãã¬ã¹ãæ¢ã«ä½¿ããã¦ãããã調ã¹ã¦ããããã§ãããæç·LANã§æ¥ç¶ããããµã¼ãéã§ããã°ãã§ãã¯ã¯1åã ãååã ã¨æãã¾ãã
@@ -251,7 +251,7 @@ if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${ipaddr[$idx]}/${prefix[$idx]}" ; then [ "${REALDEVICE}" != "lo" ] && \ - if ! /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${ipaddr[$idx]} ; then + if ! /sbin/arping -q -c 1 -D -I ${REALDEVICE} ${ipaddr[$idx]} ; then net_log $"Error, some other host already uses address ${ipaddr[$idx]}." exit 1 fi
ããã§ã2ç§å¼±ã«ã¾ã§ç縮ããã¾ããããã£ããã
# time ifup eth0 real 0m1.810s user 0m0.172s sys 0m0.487s
ã¾ãã¯ãIPã¢ãã¬ã¹ãéè¤ããªããã¨ãä¿è¨¼ã§ããã®ã§ããã°ã該å½é¨åãã³ã¡ã³ãã«ãã¦ãã¾ã£ã¦ãè¯ãã¨æãã¾ãããã®å ´åã¯1ç§ãåãã¾ãã
ã¾ã¨ã
- RHEL/CentOSã®ãããã¯ã¼ã¯ã¤ã³ã¿ãã§ã¼ã¹ã®èµ·åãé ãã®ã¯IPã¢ãã¬ã¹éè¤ãã§ãã¯ã®ãã
- éè¤ãã§ãã¯ã®å¾ æ©æéãä¿®æ£ãããã¨ã§ãããã¯ã¼ã¯ã¤ã³ã¿ãã§ã¼ã¹ã®èµ·åã¯178%é«éã«ãªã
- éè¤ãã§ãã¯èªä½ãå¤ãã°ãããã¯ã¼ã¯ã¤ã³ã¿ãã§ã¼ã¹ã®èµ·åã¯523%é«éã«ãªã
- ã·ã§ã«ã¹ã¯ãªããã®ãããã°ã¯shebangã«-xãã¤ããã¨æ¥½(#!/bin/bash -x)