| 142 | |
| 143 | === route コマンド === |
| 144 | * 以下の状態でroute addする |
| 145 | {{{ |
| 146 | Kernel IP routing table |
| 147 | Destination Gateway Genmask Flags Metric Ref Use Iface |
| 148 | 192.168.50.0 * 255.255.255.0 U 0 0 0 eth0 |
| 149 | 192.168.40.0 * 255.255.255.0 U 0 0 0 eth1 |
| 150 | 169.254.0.0 * 255.255.0.0 U 0 0 0 eth1 |
| 151 | default 192.168.50.1 0.0.0.0 UG 0 0 0 eth0 |
| 152 | }}} |
| 153 | |
| 154 | * route add default gw 192.168.40.1 |
| 155 | {{{ |
| 156 | default 192.168.40.1 0.0.0.0 UG 0 0 0 eth1 |
| 157 | default 192.168.50.1 0.0.0.0 UG 0 0 0 eth0 |
| 158 | }}} |
| 159 | * この場合、実際にはeth1を通る |
| 160 | {{{ |
| 161 | listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes |
| 162 | 02:03:27.195895 IP 192.168.40.200 > 219.94.129.108: ICMP echo request, id 51265, seq 1, length 64 |
| 163 | 02:03:27.212349 IP 219.94.129.108 > 192.168.40.200: ICMP echo reply, id 51265, seq 1, length 64 |
| 164 | }}} |
| 165 | * route add default gw 192.168.0.1 |
| 166 | {{{ |
| 167 | SIOCADDRT: Network is unreachable |
| 168 | }}} |
| 169 | * routing table は変化せず |