| 169 | |
| 170 | == default が複数あるときの挙動 == |
| 171 | * 挙動法則が不明 |
| 172 | * route コマンドで、先に表示された行のgwが必ず使われるとも限らない模様 |
| 173 | |
| 174 | * ifconfig |
| 175 | {{{ |
| 176 | eth0 => 192.168.50.100 |
| 177 | eth1 => 192.168.60.100 |
| 178 | eth2 => 192.168.70.100 |
| 179 | eth3 => 192.168.40.100 |
| 180 | }}} |
| 181 | |
| 182 | === 例1 === |
| 183 | * route |
| 184 | {{{ |
| 185 | default 192.168.70.200 0.0.0.0 UG 0 0 0 eth2 |
| 186 | default 192.168.60.200 0.0.0.0 UG 0 0 0 eth1 |
| 187 | default 192.168.50.200 0.0.0.0 UG 0 0 0 eth0 |
| 188 | default 192.168.40.200 0.0.0.0 UG 0 0 0 eth3 |
| 189 | }}} |
| 190 | * ping 219.94.129.108 -c1 |
| 191 | * client:eth2 (192.168.70.100) |
| 192 | {{{ |
| 193 | 03:20:58.808400 IP 192.168.70.100 > 219.94.129.108: ICMP echo request, id 33555, seq 1, length 64 |
| 194 | }}} |
| 195 | * gw:eth2 (192.168.70.200) |
| 196 | {{{ |
| 197 | 03:20:58.834723 IP 192.168.70.100 > 219.94.129.108: ICMP echo request, id 33555, seq 1, length 64 |
| 198 | }}} |
| 199 | |
| 200 | === 例2 === |
| 201 | * route |
| 202 | {{{ |
| 203 | default 192.168.40.200 0.0.0.0 UG 0 0 0 eth3 |
| 204 | default 192.168.50.200 0.0.0.0 UG 0 0 0 eth0 |
| 205 | default 192.168.60.200 0.0.0.0 UG 0 0 0 eth1 |
| 206 | default 192.168.70.200 0.0.0.0 UG 0 0 0 eth2 |
| 207 | }}} |
| 208 | * ping 219.94.129.108 -c1 |
| 209 | * client:eth1 (192.168.60.100) |
| 210 | {{{ |
| 211 | 03:25:08.077550 IP 192.168.60.100 > 219.94.129.108: ICMP echo request, id 37651, seq 1, length 64 |
| 212 | }}} |
| 213 | * gw:eth1 (192.168.60.200) |
| 214 | {{{ |
| 215 | 03:25:08.106974 IP 192.168.60.100 > 219.94.129.108: ICMP echo request, id 37651, seq 1, length 64 |
| 216 | }}} |
| 217 | |
| 218 | === 例3 === |
| 219 | * route |
| 220 | {{{ |
| 221 | default 192.168.50.200 0.0.0.0 UG 0 0 0 eth0 |
| 222 | default 192.168.60.200 0.0.0.0 UG 0 0 0 eth1 |
| 223 | default 192.168.70.200 0.0.0.0 UG 0 0 0 eth2 |
| 224 | default 192.168.40.200 0.0.0.0 UG 0 0 0 eth3 |
| 225 | }}} |
| 226 | * ping 219.94.129.108 -c1 |
| 227 | * client:eth3 (192.168.40.100) |
| 228 | {{{ |
| 229 | 03:29:45.739584 IP 192.168.40.100 > 219.94.129.108: ICMP echo request, id 42515, seq 1, length 64 |
| 230 | }}} |
| 231 | * gw:eth3 (192.168.40.200) |
| 232 | {{{ |
| 233 | 03:29:45.773401 IP 192.168.40.100 > 219.94.129.108: ICMP echo request, id 42515, seq 1, length 64 |
| 234 | }}} |