| 1 | [[PageOutline]] |
| 2 | |
| 3 | = NIC alias = |
| 4 | == CentOS == |
| 5 | === 設定ファイル === |
| 6 | * /etc/sysconfig/network-scripts/ |
| 7 | * ifcfg-eth?:? を作る |
| 8 | * 書式は通常の ifcfg-eth? と同じ |
| 9 | * 例 |
| 10 | * dhcp (後述) |
| 11 | {{{ |
| 12 | DEVICE=eth0:0 |
| 13 | BOOTPROTO=dhcp |
| 14 | ONBOOT=yes |
| 15 | DHCP_HOSTNAME=centos5-test |
| 16 | }}} |
| 17 | * static |
| 18 | {{{ |
| 19 | DEVICE=eth0:0 |
| 20 | BOOTPROTO=static |
| 21 | IPADDR=192.168.40.250 |
| 22 | NETMASK=255.255.255.0 |
| 23 | GATEWAY=192.168.40.2 |
| 24 | ONBOOT=yes |
| 25 | DHCP_HOSTNAME=centos5-test |
| 26 | }}} |
| 27 | * ifconfig |
| 28 | {{{ |
| 29 | eth0 Link encap:Ethernet HWaddr 00:0C:29:XX:XX:XX |
| 30 | inet addr:192.168.40.141 Bcast:192.168.40.255 Mask:255.255.255.0 |
| 31 | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
| 32 | RX packets:102642 errors:0 dropped:0 overruns:0 frame:0 |
| 33 | TX packets:1738 errors:0 dropped:0 overruns:0 carrier:0 |
| 34 | collisions:0 txqueuelen:1000 |
| 35 | RX bytes:11384683 (10.8 MiB) TX bytes:234313 (228.8 KiB) |
| 36 | Interrupt:59 Base address:0x2000 |
| 37 | |
| 38 | eth0:0 Link encap:Ethernet HWaddr 00:0C:29:XX:XX:XX |
| 39 | inet addr:192.168.40.250 Bcast:192.168.40.255 Mask:255.255.255.0 |
| 40 | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
| 41 | Interrupt:59 Base address:0x2000 |
| 42 | }}} |
| 43 | |
| 44 | === dhcpについて === |
| 45 | * ifup eth0:0 でエラーが出る |
| 46 | {{{ |
| 47 | Determining IP information for eth0:0...SIOCSIFFLAGS: Cannot assign requested address |
| 48 | SIOCSIFFLAGS: Cannot assign requested address |
| 49 | done. |
| 50 | }}} |
| 51 | * IP自体は正常にassignされる |
| 52 | * ifconfig |
| 53 | {{{ |
| 54 | eth0 Link encap:Ethernet HWaddr 00:0C:29:XX:XX:XX |
| 55 | inet addr:192.168.40.141 Bcast:192.168.40.255 Mask:255.255.255.0 |
| 56 | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
| 57 | RX packets:102862 errors:0 dropped:0 overruns:0 frame:0 |
| 58 | TX packets:1939 errors:0 dropped:0 overruns:0 carrier:0 |
| 59 | collisions:0 txqueuelen:1000 |
| 60 | RX bytes:11403063 (10.8 MiB) TX bytes:260163 (254.0 KiB) |
| 61 | Interrupt:59 Base address:0x2000 |
| 62 | |
| 63 | eth0:0 Link encap:Ethernet HWaddr 00:0C:29:XX:XX:XX |
| 64 | inet addr:192.168.40.142 Bcast:192.168.40.255 Mask:255.255.255.0 |
| 65 | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
| 66 | Interrupt:59 Base address:0x2000 |
| 67 | }}} |