[[PageOutline]] = NIC alias = * 一つの物理NICに複数のIPを割り当てる == CentOS == * [http://quox.org/tips/linux/redhat.html#net-ipalias Tips Collection - Red Hat Linux] === 設定 === * /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について === * 以下の問題は、BOOTPROTO=static の際には発生しない模様 * ifup eth0:0 でエラーが出る {{{ Determining IP information for eth0:0...SIOCSIFFLAGS: Cannot assign requested address SIOCSIFFLAGS: Cannot assign requested address done. }}} * 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 }}} * boot時のエラー * attachment:centos-alias.png * IPもassignされず * fconfig eth0:0 {{{ eth0:0 Link encap:Ethernet HWaddr 00:0C:29:XX:XX:XX UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:59 Base address:0x2000 }}} * ifup eth0:0 {{{ Determining IP information for eth0:0...SIOCSIFFLAGS: Cannot assign requested address SIOCSIFFLAGS: Cannot assign requested address SIOCGIFADDR: Cannot assign requested address SIOCSIFBROADCAST: Cannot assign requested address SIOCSIFBRDADDR: Cannot assign requested address SIOCSIFFLAGS: Cannot assign requested address done. }}} * assignされず * ifup eth0:0 {{{ Determining IP information for eth0:0...SIOCSIFFLAGS: Cannot assign requested address SIOCSIFFLAGS: Cannot assign requested address SIOCSIFFLAGS: Cannot assign requested address SIOCSIFFLAGS: Cannot assign requested address SIOCSIFFLAGS: Cannot assign requested address SIOCSIFFLAGS: Cannot assign requested address done. }}} * assignされた * ifconfig eth0:0 {{{ eth0:0 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 Interrupt:59 Base address:0x2000 }}} * assignされたりされなかったりするため、不安定