| 113 | |
| 114 | == Ubuntu == |
| 115 | * [http://quox.org/tips/linux/redhat.html#net-ipalias Tips Collection - Red Hat Linux] |
| 116 | * [http://hirokasa.jp/new/?Linux%2Fdebian%2Finterfaces Linux/debian/interfaces - hirokasa.jp] |
| 117 | |
| 118 | === 設定 === |
| 119 | * 全て /etc/network/interfaces に記述 |
| 120 | {{{ |
| 121 | # The loopback network interface |
| 122 | auto lo |
| 123 | iface lo inet loopback |
| 124 | |
| 125 | # The primary network interface |
| 126 | auto eth0 |
| 127 | iface eth0 inet dhcp |
| 128 | }}} |
| 129 | * 例 |
| 130 | * dhcp (後述) |
| 131 | {{{ |
| 132 | auto eth0:0 |
| 133 | iface eth0:0 inet dhcp |
| 134 | }}} |
| 135 | * static |
| 136 | {{{ |
| 137 | auto eth0:0 |
| 138 | iface eth0:0 inet static |
| 139 | address 192.168.40.250 |
| 140 | netmask 255.255.255.0 |
| 141 | gateway 192.168.40.2 |
| 142 | }}} |
| 143 | |
| 144 | * ifconfig (static) |
| 145 | {{{ |
| 146 | eth0 Link encap:Ethernet HWaddr 00:0c:29:YY:YY:YY |
| 147 | inet addr:192.168.40.144 Bcast:192.168.40.255 Mask:255.255.255.0 |
| 148 | inet6 addr: fe80::20c:29ff:feb1:838a/64 Scope:Link |
| 149 | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
| 150 | RX packets:1051 errors:0 dropped:0 overruns:0 frame:0 |
| 151 | TX packets:877 errors:0 dropped:0 overruns:0 carrier:0 |
| 152 | collisions:0 txqueuelen:1000 |
| 153 | RX bytes:94083 (91.8 KB) TX bytes:113925 (111.2 KB) |
| 154 | Interrupt:17 Base address:0x2000 |
| 155 | |
| 156 | eth0:0 Link encap:Ethernet HWaddr 00:0c:29:YY:YY:YY |
| 157 | inet addr:192.168.40.250 Bcast:192.168.40.255 Mask:255.255.255.0 |
| 158 | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
| 159 | Interrupt:17 Base address:0x2000 |
| 160 | }}} |
| 161 | |
| 162 | === dhcp時の問題 === |
| 163 | * CentOSと同様、dhcp時に問題が起きる |
| 164 | * dhclientのバグ? |
| 165 | * [https://bugs.launchpad.net/ubuntu/+source/dhcp3/+bug/351378 Bug #351378 in dhcp3 (Ubuntu): “dhclient fails for virtual interfaces (IP aliases)”] |
| 166 | * [https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/123773 Bug #123773 in ifupdown (Ubuntu): “'SIOCSIFFLAGS: Cannot assign requested address' when setting up ip alias”] |
| 167 | * sudo /etc/init.d/networking restart |
| 168 | {{{ |
| 169 | * Reconfiguring network interfaces... |
| 170 | There is already a pid file /var/run/dhclient.eth0.pid with pid 4361 |
| 171 | killed old client process, removed PID file |
| 172 | Internet Systems Consortium DHCP Client V3.0.6 |
| 173 | Copyright 2004-2007 Internet Systems Consortium. |
| 174 | All rights reserved. |
| 175 | For info, please visit http://www.isc.org/sw/dhcp/ |
| 176 | |
| 177 | Listening on LPF/eth0/00:0c:29:YY:YY:YY |
| 178 | Sending on LPF/eth0/00:0c:29:YY:YY:YY |
| 179 | Sending on Socket/fallback |
| 180 | There is already a pid file /var/run/dhclient.eth0.pid with pid 134519072 |
| 181 | Internet Systems Consortium DHCP Client V3.0.6 |
| 182 | Copyright 2004-2007 Internet Systems Consortium. |
| 183 | All rights reserved. |
| 184 | For info, please visit http://www.isc.org/sw/dhcp/ |
| 185 | |
| 186 | Listening on LPF/eth0/00:0c:29:YY:YY:YY |
| 187 | Sending on LPF/eth0/00:0c:29:YY:YY:YY |
| 188 | Sending on Socket/fallback |
| 189 | DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4 |
| 190 | DHCPOFFER of 192.168.40.144 from 192.168.40.254 |
| 191 | DHCPREQUEST of 192.168.40.144 on eth0 to 255.255.255.255 port 67 |
| 192 | DHCPACK of 192.168.40.144 from 192.168.40.254 |
| 193 | bound to 192.168.40.144 -- renewal in 855 seconds. |
| 194 | SIOCSIFFLAGS: Cannot assign requested address |
| 195 | Internet Systems Consortium DHCP Client V3.0.6 |
| 196 | Copyright 2004-2007 Internet Systems Consortium. |
| 197 | All rights reserved. |
| 198 | For info, please visit http://www.isc.org/sw/dhcp/ |
| 199 | |
| 200 | SIOCSIFFLAGS: Cannot assign requested address |
| 201 | SIOCSIFFLAGS: Cannot assign requested address |
| 202 | Bind socket to interface: No such device |
| 203 | Failed to bring up eth0:0. |
| 204 | [ OK ] |
| 205 | }}} |
| 206 | * sudo ifup eth0:0 |
| 207 | {{{ |
| 208 | SIOCSIFFLAGS: Cannot assign requested address |
| 209 | There is already a pid file /var/run/dhclient.eth0:0.pid with pid 134519072 |
| 210 | Internet Systems Consortium DHCP Client V3.0.6 |
| 211 | Copyright 2004-2007 Internet Systems Consortium. |
| 212 | All rights reserved. |
| 213 | For info, please visit http://www.isc.org/sw/dhcp/ |
| 214 | |
| 215 | SIOCSIFFLAGS: Cannot assign requested address |
| 216 | SIOCSIFFLAGS: Cannot assign requested address |
| 217 | Bind socket to interface: No such device |
| 218 | Failed to bring up eth0:0. |
| 219 | }}} |