| | 1 | [[PageOutline]] |
| | 2 | |
| | 3 | = 到達テスト = |
| | 4 | * wiki:TipAndDoc/network/vmtest#networkmap のネットワークを使用 |
| | 5 | * <eth0> などとなっているのはデフォルトゲートウェイを示す |
| | 6 | |
| | 7 | * VMを使ったせいか、おかしな挙動が見られたので注意 => [#unexpected] |
| | 8 | * 実機で追試が必要? |
| | 9 | |
| | 10 | = パケットロスするケース = |
| | 11 | == inner-BB -> router -> centos-outer -> WAN == |
| | 12 | * パケット経路 |
| | 13 | 1. inner-BB:<eth0> |
| | 14 | 1. router:eth2 |
| | 15 | 1. router:<eth0> |
| | 16 | 1. centos-outer:eth1 |
| | 17 | 1. centos-outer:<eth0> -> WAN |
| | 18 | |
| | 19 | * ubuntu-inner-BB:~$ ping 10.0.0.20 -c 1 |
| | 20 | {{{ |
| | 21 | PING 10.0.0.20 (10.0.0.20) 56(84) bytes of data. |
| | 22 | |
| | 23 | --- 10.0.0.20 ping statistics --- |
| | 24 | 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
| | 25 | }}} |
| | 26 | 1. ubuntu-inner-BB:~$ sudo tcpdump -p -n icmp -i eth0 |
| | 27 | {{{ |
| | 28 | 18:09:56.550982 IP 10.2.0.10 > 10.0.0.20: ICMP echo request, id 45848, seq 1, length 64 |
| | 29 | }}} |
| | 30 | 1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth2 |
| | 31 | {{{ |
| | 32 | 18:09:56.719082 IP 10.2.0.10 > 10.0.0.20: ICMP echo request, id 45848, seq 1, length 64 |
| | 33 | }}} |
| | 34 | 1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth0 |
| | 35 | {{{ |
| | 36 | 18:09:56.719179 IP 10.2.0.10 > 10.0.0.20: ICMP echo request, id 45848, seq 1, length 64 |
| | 37 | }}} |
| | 38 | 1. centos-outer ~]$ sudo tcpdump -p -n icmp -i eth1 |
| | 39 | {{{ |
| | 40 | 18:09:56.864853 IP 10.2.0.10 > 10.0.0.20: ICMP echo request, id 45848, seq 1, length 64 |
| | 41 | }}} |
| | 42 | 1. centos-outer ~]$ sudo tcpdump -p -n icmp -i eth0 |
| | 43 | {{{ |
| | 44 | 18:09:56.865503 IP 10.0.0.20 > 10.2.0.10: ICMP echo reply, id 45848, seq 1, length 64 |
| | 45 | }}} |
| | 46 | |
| | 47 | == centos-inner -> WAN == |
| | 48 | * パケット経路 |
| | 49 | 1. centos-inner:<eth0> -> WAN |
| | 50 | |
| | 51 | * centos-inner ~]$ ping 10.0.0.10 -c 1 |
| | 52 | {{{ |
| | 53 | PING 10.0.0.10 (10.0.0.10) 56(84) bytes of data. |
| | 54 | |
| | 55 | --- 10.0.0.10 ping statistics --- |
| | 56 | 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
| | 57 | }}} |
| | 58 | 1. centos-inner ~]$ sudo tcpdump -p -n icmp -i eth0 |
| | 59 | {{{ |
| | 60 | 20:07:51.313947 IP 192.168.50.110 > 10.0.0.10: ICMP echo request, id 44813, seq 1, length 64 |
| | 61 | }}} |
| | 62 | |
| | 63 | == centos-outer -> WAN == |
| | 64 | * パケット経路 |
| | 65 | 1. centos-outer:<eth0> -> WAN |
| | 66 | |
| | 67 | * centos-outer ~]$ ping 10.1.0.110 -c 1 |
| | 68 | {{{ |
| | 69 | PING 10.1.0.110 (10.1.0.110) 56(84) bytes of data. |
| | 70 | |
| | 71 | --- 10.1.0.110 ping statistics --- |
| | 72 | 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
| | 73 | }}} |
| | 74 | 1. centos-outer ~]$ sudo tcpdump -p -n icmp -i eth0 |
| | 75 | {{{ |
| | 76 | 20:17:30.551763 IP 192.168.40.20 > 10.1.0.110: ICMP echo request, id 48141, seq 1, length 64 |
| | 77 | }}} |
| | 78 | |
| | 79 | == ubuntu-outer -> router -> centos-inner -> WAN == |
| | 80 | * パケット経路 |
| | 81 | 1. ubuntu-outer:<eth1> |
| | 82 | 1. router:<eth0> |
| | 83 | 1. router:eth1 |
| | 84 | 1. centos-inner:eth1 |
| | 85 | 1. centos-inner:<eth0> -> WAN |
| | 86 | |
| | 87 | * ubuntu-outer:~$ ping 10.1.0.110 -c 1 |
| | 88 | {{{ |
| | 89 | PING 10.1.0.110 (10.1.0.110) 56(84) bytes of data. |
| | 90 | |
| | 91 | --- 10.1.0.110 ping statistics --- |
| | 92 | 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
| | 93 | }}} |
| | 94 | 1. ubuntu-outer:~$ sudo tcpdump -p -n icmp -i eth1 |
| | 95 | {{{ |
| | 96 | 20:29:41.465087 IP 10.0.0.10 > 10.1.0.110: ICMP echo request, id 31255, seq 1, length 64 |
| | 97 | }}} |
| | 98 | 1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth0 |
| | 99 | {{{ |
| | 100 | 20:29:41.471692 IP 10.0.0.10 > 10.1.0.110: ICMP echo request, id 31255, seq 1, length 64 |
| | 101 | }}} |
| | 102 | 1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth1 |
| | 103 | {{{ |
| | 104 | 20:29:41.481482 IP 10.0.0.10 > 10.1.0.110: ICMP echo request, id 31255, seq 1, length 64 |
| | 105 | }}} |
| | 106 | 1. centos-inner ~]$ sudo tcpdump -p -n icmp -i eth1 |
| | 107 | {{{ |
| | 108 | 20:29:41.437276 IP 10.0.0.10 > 10.1.0.110: ICMP echo request, id 31255, seq 1, length 64 |
| | 109 | }}} |
| | 110 | 1. centos-inner ~]$ sudo tcpdump -p -n icmp -i eth0 |
| | 111 | {{{ |
| | 112 | 20:29:41.438220 IP 10.1.0.110 > 10.0.0.10: ICMP echo reply, id 31255, seq 1, length 64 |
| | 113 | }}} |
| | 114 | |
| | 115 | = 正常なケース = |
| | 116 | == ubuntu-inner-BB <= ubuntu-router => ubuntu-outer == |
| | 117 | * パケット経路 |
| | 118 | 1. inner-BB:<eth0> |
| | 119 | 1. router:eth2 |
| | 120 | 1. router:<eth0> |
| | 121 | 1. ubuntu-outer:<eth1> |
| | 122 | 1. ubuntu-outer:<eth1> |
| | 123 | 1. router:<eth0> |
| | 124 | 1. router:eth2 |
| | 125 | 1. inner-BB:<eth0> |
| | 126 | |
| | 127 | * ubuntu-inner-BB:~$ ping 10.0.0.10 -c 1 |
| | 128 | {{{ |
| | 129 | PING 10.0.0.10 (10.0.0.10) 56(84) bytes of data. |
| | 130 | 64 bytes from 10.0.0.10: icmp_seq=1 ttl=63 time=10.0 ms |
| | 131 | |
| | 132 | --- 10.0.0.10 ping statistics --- |
| | 133 | 1 packets transmitted, 1 received, 0% packet loss, time 0ms |
| | 134 | rtt min/avg/max/mdev = 10.017/10.017/10.017/0.000 ms |
| | 135 | }}} |
| | 136 | 1. ubuntu-inner-BB:~$ sudo tcpdump -p -n icmp -i eth0 |
| | 137 | {{{ |
| | 138 | 18:04:53.003357 IP 10.2.0.10 > 10.0.0.10: ICMP echo request, id 35352, seq 1, length 64 |
| | 139 | 18:04:53.013360 IP 10.0.0.10 > 10.2.0.10: ICMP echo reply, id 35352, seq 1, length 64 |
| | 140 | }}} |
| | 141 | 1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth2 |
| | 142 | {{{ |
| | 143 | 18:04:53.180070 IP 10.2.0.10 > 10.0.0.10: ICMP echo request, id 35352, seq 1, length 64 |
| | 144 | 18:04:53.180372 IP 10.0.0.10 > 10.2.0.10: ICMP echo reply, id 35352, seq 1, length 64 |
| | 145 | }}} |
| | 146 | 1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth0 |
| | 147 | {{{ |
| | 148 | 18:04:53.180105 IP 10.2.0.10 > 10.0.0.10: ICMP echo request, id 35352, seq 1, length 64 |
| | 149 | 18:04:53.180366 IP 10.0.0.10 > 10.2.0.10: ICMP echo reply, id 35352, seq 1, length 64 |
| | 150 | }}} |
| | 151 | 1. ubuntu-outer:~$ sudo tcpdump -p -n icmp -i eth1 |
| | 152 | {{{ |
| | 153 | 18:04:53.177594 IP 10.2.0.10 > 10.0.0.10: ICMP echo request, id 35352, seq 1, length 64 |
| | 154 | 18:04:53.177684 IP 10.0.0.10 > 10.2.0.10: ICMP echo reply, id 35352, seq 1, length 64 |
| | 155 | }}} |
| | 156 | |
| | 157 | == 違う経路で帰ってくるケース == |
| | 158 | === ubuntu-outer <= ubuntu-router => ubuntu-inner-AB === |
| | 159 | * パケット経路 |
| | 160 | 1. ubuntu-outer:<eth1> |
| | 161 | 1. router:<eth0> |
| | 162 | 1. router:eth1 |
| | 163 | 1. inner-AB:eth0 |
| | 164 | 1. inner-AB:<eth1> |
| | 165 | 1. router:eth2 |
| | 166 | 1. router:<eth0> |
| | 167 | 1. ubuntu-outer:<eth1> |
| | 168 | |
| | 169 | * ubuntu-outer:~$ ping 10.1.0.30 -c 1 |
| | 170 | {{{ |
| | 171 | PING 10.1.0.30 (10.1.0.30) 56(84) bytes of data. |
| | 172 | 64 bytes from 10.1.0.30: icmp_seq=1 ttl=63 time=36.8 ms |
| | 173 | |
| | 174 | --- 10.1.0.30 ping statistics --- |
| | 175 | 1 packets transmitted, 1 received, 0% packet loss, time 0ms |
| | 176 | rtt min/avg/max/mdev = 36.889/36.889/36.889/0.000 ms |
| | 177 | }}} |
| | 178 | 1. ubuntu-outer:~$ sudo tcpdump -p -n icmp -i eth1 |
| | 179 | {{{ |
| | 180 | 20:36:54.692467 IP 10.0.0.10 > 10.1.0.30: ICMP echo request, id 45847, seq 1, length 64 |
| | 181 | 20:36:54.712537 IP 10.1.0.30 > 10.0.0.10: ICMP echo reply, id 45847, seq 1, length 64 |
| | 182 | }}} |
| | 183 | 1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth0 |
| | 184 | {{{ |
| | 185 | 20:36:54.699054 IP 10.0.0.10 > 10.1.0.30: ICMP echo request, id 45847, seq 1, length 64 |
| | 186 | 20:36:54.718482 IP 10.1.0.30 > 10.0.0.10: ICMP echo reply, id 45847, seq 1, length 64 |
| | 187 | }}} |
| | 188 | 1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth1 |
| | 189 | {{{ |
| | 190 | 20:36:54.711750 IP 10.0.0.10 > 10.1.0.30: ICMP echo request, id 45847, seq 1, length 64 |
| | 191 | }}} |
| | 192 | 1. ubuntu-inner-AB:~$ sudo tcpdump -p -n icmp -i eth0 |
| | 193 | {{{ |
| | 194 | 20:36:54.703190 IP 10.0.0.10 > 10.1.0.30: ICMP echo request, id 45847, seq 1, length 64 |
| | 195 | }}} |
| | 196 | 1. ubuntu-inner-AB:~$ sudo tcpdump -p -n icmp -i eth1 |
| | 197 | {{{ |
| | 198 | 20:36:54.706993 IP 10.1.0.30 > 10.0.0.10: ICMP echo reply, id 45847, seq 1, length 64 |
| | 199 | }}} |
| | 200 | 1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth2 |
| | 201 | {{{ |
| | 202 | 20:36:54.718451 IP 10.1.0.30 > 10.0.0.10: ICMP echo reply, id 45847, seq 1, length 64 |
| | 203 | }}} |
| | 204 | |
| | 205 | == おかしな挙動 == #unexpected |
| | 206 | * 指定したIPがバインドされたNICを通らずに通信されている |
| | 207 | |
| | 208 | === ubuntu-outer <= ubuntu-router => inner-AA === |
| | 209 | * inner-AA:eth1 = 10.1.0.20 なので、eth1を通るはずなのにeth0を通っている |
| | 210 | |
| | 211 | * ubuntu-outer:~$ ping 10.1.0.20 -c 1 |
| | 212 | {{{ |
| | 213 | PING 10.1.0.20 (10.1.0.20) 56(84) bytes of data. |
| | 214 | 64 bytes from 10.1.0.20: icmp_seq=1 ttl=63 time=25.5 ms |
| | 215 | |
| | 216 | --- 10.1.0.20 ping statistics --- |
| | 217 | 1 packets transmitted, 1 received, 0% packet loss, time 0ms |
| | 218 | rtt min/avg/max/mdev = 25.532/25.532/25.532/0.000 ms |
| | 219 | }}} |
| | 220 | 1. ubuntu-outer:~$ sudo tcpdump -p -n icmp -i eth1 |
| | 221 | {{{ |
| | 222 | 20:14:02.893113 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 60438, seq 1, length 64 |
| | 223 | 20:14:02.914912 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 60438, seq 1, length 64 |
| | 224 | }}} |
| | 225 | 1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth0 |
| | 226 | {{{ |
| | 227 | 20:14:02.900364 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 60438, seq 1, length 64 |
| | 228 | 20:14:02.920840 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 60438, seq 1, length 64 |
| | 229 | }}} |
| | 230 | 1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth1 |
| | 231 | {{{ |
| | 232 | 20:14:02.900768 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 60438, seq 1, length 64 |
| | 233 | 20:14:02.920824 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 60438, seq 1, length 64 |
| | 234 | }}} |
| | 235 | 1. ubuntu-inner-AA:~$ sudo tcpdump -p -n icmp -i eth0 |
| | 236 | {{{ |
| | 237 | 20:14:02.888999 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 60438, seq 1, length 64 |
| | 238 | 20:14:02.906825 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 60438, seq 1, length 64 |
| | 239 | }}} |
| | 240 | |
| | 241 | === ubuntu-outer <= ubuntu-router => inner-BB === |
| | 242 | * inner-BB:eth1 = 10.2.0.20 なので、eth1を通るはずなのにeth0を通っている |
| | 243 | |
| | 244 | * ubuntu-outer:~$ ping 10.2.0.20 -c 1 |
| | 245 | {{{ |
| | 246 | PING 10.2.0.20 (10.2.0.20) 56(84) bytes of data. |
| | 247 | 64 bytes from 10.2.0.20: icmp_seq=1 ttl=63 time=26.0 ms |
| | 248 | |
| | 249 | --- 10.2.0.20 ping statistics --- |
| | 250 | 1 packets transmitted, 1 received, 0% packet loss, time 0ms |
| | 251 | rtt min/avg/max/mdev = 26.001/26.001/26.001/0.000 ms |
| | 252 | }}} |
| | 253 | 1. ubuntu-outer:~$ sudo tcpdump -p -n icmp -i eth1 |
| | 254 | {{{ |
| | 255 | 21:46:14.403188 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 57113, seq 1, length 64 |
| | 256 | 21:46:14.419804 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 57113, seq 1, length 64 |
| | 257 | }}} |
| | 258 | 1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth0 |
| | 259 | {{{ |
| | 260 | 21:46:14.409977 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 57113, seq 1, length 64 |
| | 261 | 21:46:14.424457 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 57113, seq 1, length 64 |
| | 262 | }}} |
| | 263 | 1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth2 |
| | 264 | {{{ |
| | 265 | 21:46:14.423153 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 57113, seq 1, length 64 |
| | 266 | 21:46:14.424369 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 57113, seq 1, length 64 |
| | 267 | }}} |
| | 268 | 1. ubuntu-inner-BB:~$ sudo tcpdump -p -n icmp -i eth0 |
| | 269 | {{{ |
| | 270 | 21:46:14.417399 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 57113, seq 1, length 64 |
| | 271 | 21:46:14.434352 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 57113, seq 1, length 64 |
| | 272 | }}} |
| | 273 | |
| | 274 | ==== (仮想NICからケーブルを)物理的に切断してみる ==== |
| | 275 | * VMのNICから(仮想的に)LANケーブルを切断する |
| | 276 | |
| | 277 | * ubuntu-outer:~$ ping 10.2.0.20 |
| | 278 | {{{ |
| | 279 | PING 10.2.0.20 (10.2.0.20) 56(84) bytes of data. |
| | 280 | |
| | 281 | (snip) |
| | 282 | |
| | 283 | 64 bytes from 10.2.0.20: icmp_seq=18 ttl=63 time=2.41 ms |
| | 284 | 64 bytes from 10.2.0.20: icmp_seq=19 ttl=63 time=4.53 ms |
| | 285 | 64 bytes from 10.2.0.20: icmp_seq=20 ttl=63 time=1.42 ms |
| | 286 | 64 bytes from 10.2.0.20: icmp_seq=21 ttl=63 time=2.76 ms |
| | 287 | 64 bytes from 10.2.0.20: icmp_seq=33 ttl=63 time=1.07 ms |
| | 288 | 64 bytes from 10.2.0.20: icmp_seq=34 ttl=63 time=1.21 ms |
| | 289 | |
| | 290 | --- 10.2.0.20 ping statistics --- |
| | 291 | 34 packets transmitted, 23 received, 32% packet loss, time 33009ms |
| | 292 | rtt min/avg/max/mdev = 0.635/2.304/4.539/0.935 ms |
| | 293 | }}} |
| | 294 | 1. 途中、eth1を切断してもpingは通り続けた |
| | 295 | 1. eth0を切断するとpacket lost |
| | 296 | 1. ubuntu-inner-BB:~$ sudo tcpdump -p -n icmp -i eth0 |
| | 297 | {{{ |
| | 298 | 22:07:09.562788 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 38682, seq 18, length 64 |
| | 299 | 22:07:10.574025 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 38682, seq 19, length 64 |
| | 300 | 22:07:10.574061 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 38682, seq 19, length 64 |
| | 301 | 22:07:11.571686 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 38682, seq 20, length 64 |
| | 302 | 22:07:11.571709 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 38682, seq 20, length 64 |
| | 303 | 22:07:12.572202 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 38682, seq 21, length 64 |
| | 304 | 22:07:12.572225 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 38682, seq 21, length 64 |
| | 305 | 22:07:24.572056 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 38682, seq 33, length 64 |
| | 306 | 22:07:24.572299 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 38682, seq 33, length 64 |
| | 307 | 22:07:25.572061 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 38682, seq 34, length 64 |
| | 308 | 22:07:25.572149 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 38682, seq 34, length 64 |
| | 309 | }}} |
| | 310 | * eth1をダウンさせても変わらず |
| | 311 | 1. ubuntu-inner-BB:~$ sudo tcpdump -p -n icmp -i eth1 |
| | 312 | {{{ |
| | 313 | tcpdump: bind: Network is down |
| | 314 | }}} |
| | 315 | 1. ubuntu-inner-BB:~$ ifconfig eth1 |
| | 316 | {{{ |
| | 317 | eth1 Link encap:Ethernet HWaddr 00:0c:29:ZZ:ZZ:ZZ |
| | 318 | inet addr:10.2.0.20 Bcast:10.2.255.255 Mask:255.255.0.0 |
| | 319 | }}} |
| | 320 | * 何故かIPがバインドされたまま |
| | 321 | |
| | 322 | * VMで同じセグメント(仮想HUB)にNICを繋げているせい? |