Changes between Version 1 and Version 2 of TipAndDoc/VM/network/iproute


Ignore:
Timestamp:
Jun 27, 2009 3:52:55 AM (15 years ago)
Author:
mitty
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TipAndDoc/VM/network/iproute

    v1 v2  
    213213  immediately. It is assumed that after a script finishes a batch of updates, it flushes 
    214214  the routing cache with '''ip route flush cache'''. 
     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{{{ 
     241PING 10.1.0.20 (10.1.0.20) 56(84) bytes of data. 
     24264 bytes from 10.1.0.20: icmp_seq=1 ttl=63 time=18.0 ms 
     243 
     244--- 10.1.0.20 ping statistics --- 
     2451 packets transmitted, 1 received, 0% packet loss, time 0ms 
     246rtt min/avg/max/mdev = 18.019/18.019/18.019/0.000 ms 
     247}}} 
     248   1. ubuntu-outer:eth1 
     249{{{ 
     25003:21:26.529593 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 28200, seq 1, length 64 
     25103: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{{{ 
     25503:21:26.528120 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 28200, seq 1, length 64 
     25603: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{{{ 
     26003:21:26.529233 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 28200, seq 1, length 64 
     26103:21:26.534766 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 28200, seq 1, length 64 
     26203: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{{{ 
     26603:21:26.516873 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 28200, seq 1, length 64 
     26703: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{{{ 
     27103: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{{{ 
     27803:31:16.124510 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 49704, seq 1, length 64 
     27903: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{{{ 
     28803: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{{{ 
     29203: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{{{ 
     29903:46:28.309953 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 16425, seq 1, length 64 
     30003:46:28.310817 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 16425, seq 1, length 64 
     301}}}