| 215 | |
| 216 | = ubuntu-inner-AB = |
| 217 | * see [../ping#ubuntu-outerrouterubuntu-inner-AB] |
| 218 | |
| 219 | * routing table 設定 |
| 220 | 1. sudo ip route add default via 10.1.0.254 table 1 |
| 221 | 1. sudo ip route add default via 10.2.0.254 table 2 |
| 222 | * routing policy 設定 |
| 223 | 1. sudo ip rule add from 10.1.0.0/16 table 1 prio 1 |
| 224 | 1. sudo ip rule add from 10.2.0.0/16 table 2 prio 2 |
| 225 | * 上記[#centos-inner]と同様に、NICのIP or networkのどちらでも良い |
| 226 | |
| 227 | = ubuntu-inner-AA = |
| 228 | * see [../ping#unexpected] |
| 229 | |
| 230 | * routing table 設定 |
| 231 | 1. sudo ip route add default via 10.1.0.254 dev eth0 table 10 |
| 232 | 1. sudo ip route add default via 10.1.0.254 dev eth1 table 20 |
| 233 | * routing policy 設定 |
| 234 | 1. sudo ip rule add from 10.1.0.10 table 10 prio 1 |
| 235 | 1. sudo ip rule add from 10.1.0.20 table 20 prio 2 |
| 236 | |
| 237 | * ~~requestに関しては、eth1(10.1.0.20)ではなくeth0(10.1.0.10)側に届いてしまう~~ |
| 238 | * ~~VMなのが問題なのか、route設定がおかしいのか謎~~ |
| 239 | * ubuntu-outer:~$ ping 10.1.0.20 -c 1 |
| 240 | {{{ |
| 241 | PING 10.1.0.20 (10.1.0.20) 56(84) bytes of data. |
| 242 | 64 bytes from 10.1.0.20: icmp_seq=1 ttl=63 time=18.0 ms |
| 243 | |
| 244 | --- 10.1.0.20 ping statistics --- |
| 245 | 1 packets transmitted, 1 received, 0% packet loss, time 0ms |
| 246 | rtt min/avg/max/mdev = 18.019/18.019/18.019/0.000 ms |
| 247 | }}} |
| 248 | 1. ubuntu-outer:eth1 |
| 249 | {{{ |
| 250 | 03:21:26.529593 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 28200, seq 1, length 64 |
| 251 | 03:21:26.547598 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 28200, seq 1, length 64 |
| 252 | }}} |
| 253 | 1. ubuntu-router:eth0 |
| 254 | {{{ |
| 255 | 03:21:26.528120 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 28200, seq 1, length 64 |
| 256 | 03:21:26.535301 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 28200, seq 1, length 64 |
| 257 | }}} |
| 258 | 1. ubuntu-router:eth1 |
| 259 | {{{ |
| 260 | 03:21:26.529233 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 28200, seq 1, length 64 |
| 261 | 03:21:26.534766 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 28200, seq 1, length 64 |
| 262 | 03:21:26.535841 IP 10.1.0.254 > 10.1.0.10: ICMP redirect 10.1.0.110 to host 10.1.0.110, length 188 |
| 263 | }}} |
| 264 | 1. ubuntu-inner-AA:eth0 |
| 265 | {{{ |
| 266 | 03:21:26.516873 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 28200, seq 1, length 64 |
| 267 | 03:21:26.523308 IP 10.1.0.254 > 10.1.0.10: ICMP redirect 10.1.0.110 to host 10.1.0.110, length 188 |
| 268 | }}} |
| 269 | 1. ubuntu-inner-AA:eth1 |
| 270 | {{{ |
| 271 | 03:21:26.520911 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 28200, seq 1, length 64 |
| 272 | }}} |
| 273 | |
| 274 | * 数分放置したところrequestもeth1に届くようになった => cacheのせい? |
| 275 | * ubuntu-outer:~$ ping 10.1.0.20 -c 1 |
| 276 | 1. ubuntu-inner-AA:eth1 |
| 277 | {{{ |
| 278 | 03:31:16.124510 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 49704, seq 1, length 64 |
| 279 | 03:31:16.125227 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 49704, seq 1, length 64 |
| 280 | }}} |
| 281 | |
| 282 | * ubuntu-inner-AA上のrouting policyを削除したところ、前とは逆にeth1にrequest、eth0からreplyという状態になった。 |
| 283 | * ubuntu-inner-AA:~$ sudo ip rule del prefer 1 |
| 284 | * ubuntu-inner-AA:~$ sudo ip rule del prefer 2 |
| 285 | * ubuntu-outer:~$ ping 10.1.0.20 -c 1 |
| 286 | 1. ubuntu-inner-AA:eth1 |
| 287 | {{{ |
| 288 | 03:35:13.581262 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 58152, seq 1, length 64 |
| 289 | }}} |
| 290 | 1. ubuntu-inner-AA:eth0 |
| 291 | {{{ |
| 292 | 03:35:13.581520 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 58152, seq 1, length 64 |
| 293 | }}} |
| 294 | * ~~いよいよもって謎。~~ |
| 295 | * これも数分放置したところ、eth0のみを通る状態に戻ったので、やはりcacheのせいと思われる |
| 296 | * ubuntu-outer:~$ ping 10.1.0.20 -c 1 |
| 297 | 1. ubuntu-inner-AA:eth0 |
| 298 | {{{ |
| 299 | 03:46:28.309953 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 16425, seq 1, length 64 |
| 300 | 03:46:28.310817 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 16425, seq 1, length 64 |
| 301 | }}} |