wiki:TipAndDoc/network/alias

Version 2 (modified by mitty, 15 years ago) (diff)

--

NIC alias

CentOS

設定ファイル

  • /etc/sysconfig/network-scripts/
    • ifcfg-eth?:? を作る
    • 書式は通常の ifcfg-eth? と同じ
      • dhcp (後述)
        DEVICE=eth0:0
        BOOTPROTO=dhcp
        ONBOOT=yes
        DHCP_HOSTNAME=centos5-test
        
      • static
        DEVICE=eth0:0
        BOOTPROTO=static
        IPADDR=192.168.40.250
        NETMASK=255.255.255.0
        GATEWAY=192.168.40.2
        ONBOOT=yes
        DHCP_HOSTNAME=centos5-test
        
  • ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:0C:29:XX:XX:XX
              inet addr:192.168.40.141  Bcast:192.168.40.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:102642 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1738 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:11384683 (10.8 MiB)  TX bytes:234313 (228.8 KiB)
              Interrupt:59 Base address:0x2000
    
    eth0:0    Link encap:Ethernet  HWaddr 00:0C:29:XX:XX:XX
              inet addr:192.168.40.250  Bcast:192.168.40.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Interrupt:59 Base address:0x2000
    

dhcpについて

  • ifup eth0:0 でエラーが出る
    Determining IP information for eth0:0...SIOCSIFFLAGS: Cannot assign requested address
    SIOCSIFFLAGS: Cannot assign requested address
     done.
    
  • boot時のエラー
  • IP自体は正常にassignされる
    • ifconfig
      eth0      Link encap:Ethernet  HWaddr 00:0C:29:XX:XX:XX
                inet addr:192.168.40.141  Bcast:192.168.40.255  Mask:255.255.255.0
                UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                RX packets:102862 errors:0 dropped:0 overruns:0 frame:0
                TX packets:1939 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:1000
                RX bytes:11403063 (10.8 MiB)  TX bytes:260163 (254.0 KiB)
                Interrupt:59 Base address:0x2000
      
      eth0:0    Link encap:Ethernet  HWaddr 00:0C:29:XX:XX:XX
                inet addr:192.168.40.142  Bcast:192.168.40.255  Mask:255.255.255.0
                UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                Interrupt:59 Base address:0x2000
      

Attachments (3)

Download all attachments as: .zip