6月 232014
 

美国FDC西雅图机房到阿里云香港节点路由

[root@mon-sea ~]$ tracepath 58.96.169.52
1: mon-sea (192.240.101.xxx) 0.167ms pmtu 1500
1: 50.7.72.129 (50.7.72.129) 5.492ms
1: 50.7.72.129 (50.7.72.129) 0.969ms
2: ae1.mpr1.sea1.us.above.net (208.184.53.193) 0.462ms
3: ae10.cr1.sjc2.us.above.net (64.125.21.25) 17.555ms
4: ae6.mpr1.pao1.us.above.net (64.125.31.46) 18.233ms
5: ge-0-0-1.0.ejr02.pao001.flagtel.com (198.32.176.137) 18.799ms asymm 6
6: so-0-1-1.0.pjr01.wad001.flagtel.com (62.216.128.2) 170.897ms asymm 13
7: ge-0-3-0.0.pjr02.hkg005.flagtel.com (85.95.26.89) 172.159ms asymm 12
8: so-5-0-0.0.cjr04.hkg003.flagtel.com (85.95.25.214) 174.487ms
9: xe-2-2-0.0.cji02.hkg003.flagtel.com (62.216.128.102) 172.114ms asymm 10
10: 80.77.0.198 (80.77.0.198) 170.967ms
11: 202.123.74.121 (202.123.74.121) 172.332ms
12: 58.96.160.245 (58.96.160.245) 171.111ms
13: 58.96.160.234 (58.96.160.234) 172.061ms
14: 58.96.160.241 (58.96.160.241) 170.377ms asymm 13
15: no reply
16: 58.96.169.52 (58.96.169.52) 171.787ms !H
Resume: pmtu 1500
[root@mon-sea ~]$
[root@mon-sea ~]$ ping -c 8 58.96.169.52

延时

PING 58.96.169.52 (58.96.169.52) 56(84) bytes of data.
64 bytes from 58.96.169.52: icmp_seq=1 ttl=52 time=171 ms
64 bytes from 58.96.169.52: icmp_seq=2 ttl=52 time=174 ms
64 bytes from 58.96.169.52: icmp_seq=3 ttl=52 time=172 ms
64 bytes from 58.96.169.52: icmp_seq=4 ttl=52 time=171 ms
64 bytes from 58.96.169.52: icmp_seq=5 ttl=52 time=173 ms
64 bytes from 58.96.169.52: icmp_seq=6 ttl=52 time=182 ms
64 bytes from 58.96.169.52: icmp_seq=7 ttl=52 time=183 ms
64 bytes from 58.96.169.52: icmp_seq=8 ttl=52 time=172 ms

— 58.96.169.52 ping statistics —
8 packets transmitted, 8 received, 0% packet loss, time 7183ms
rtt min/avg/max/mdev = 171.109/175.191/183.139/4.566 ms
[root@mon-sea ~]$

美国FDC洛杉矶机房到阿里云香港节点路由

[root@mon-lax ~]$ tracepath 58.96.169.52
1: mon-lax (50.7.103.xx) 0.165ms pmtu 1500
1: 50.7.102.201 (50.7.102.201) 1.236ms
1: 50.7.102.201 (50.7.102.201) 0.918ms
2: ae1.er3.lax112.us.above.net (208.184.110.153) 0.452ms
3: ae6.cr1.lax112.us.above.net (64.125.20.221) 0.493ms
4: ae1.cr2.sjc2.us.above.net (64.125.31.233) 10.502ms
5: ae3.cr1.sjc2.us.above.net (64.125.26.26) 8.720ms asymm 4
6: ae6.mpr1.pao1.us.above.net (64.125.31.46) 9.541ms asymm 5
7: ge-0-0-1.0.ejr02.pao001.flagtel.com (198.32.176.137) 9.959ms
8: so-0-1-1.0.pjr01.wad001.flagtel.com (62.216.128.2) 161.433ms asymm 14
9: ge-0-3-0.0.pjr02.hkg005.flagtel.com (85.95.26.89) 183.356ms asymm 13
10: so-5-0-0.0.cjr04.hkg003.flagtel.com (85.95.25.214) 166.270ms asymm 9
11: xe-2-2-0.0.cji02.hkg003.flagtel.com (62.216.128.102) 161.535ms
12: 80.77.0.198 (80.77.0.198) 164.378ms asymm 11
13: 202.123.74.121 (202.123.74.121) 179.274ms asymm 12
14: 58.96.160.245 (58.96.160.245) 162.333ms asymm 13
15: 58.96.160.234 (58.96.160.234) 166.776ms asymm 13
16: 58.96.160.241 (58.96.160.241) 161.198ms asymm 14
17: no reply
18: 58.96.169.52 (58.96.169.52) 161.058ms !H
Resume: pmtu 1500
[root@mon-lax ~]$
[root@mon-lax ~]$ ping -c 8 58.96.169.52
PING 58.96.169.52 (58.96.169.52) 56(84) bytes of data.
64 bytes from 58.96.169.52: icmp_seq=1 ttl=51 time=161 ms
64 bytes from 58.96.169.52: icmp_seq=2 ttl=51 time=163 ms
64 bytes from 58.96.169.52: icmp_seq=3 ttl=51 time=161 ms
64 bytes from 58.96.169.52: icmp_seq=4 ttl=51 time=162 ms
64 bytes from 58.96.169.52: icmp_seq=5 ttl=51 time=162 ms
64 bytes from 58.96.169.52: icmp_seq=6 ttl=51 time=164 ms
64 bytes from 58.96.169.52: icmp_seq=7 ttl=51 time=162 ms
64 bytes from 58.96.169.52: icmp_seq=8 ttl=51 time=162 ms

— 58.96.169.52 ping statistics —
8 packets transmitted, 8 received, 0% packet loss, time 7171ms
rtt min/avg/max/mdev = 161.219/162.574/164.032/0.949 ms
[root@mon-lax ~]$

阿里云北京节点到香港节点路由

[root@AY1405192126447871b3Z ~]# tracepath 58.96.169.52
1: 182.92.x.xx (182.92.x.xx) 0.124ms pmtu 1500
1: 182.92.3.249 (182.92.3.249) 0.490ms
1: 182.92.3.249 (182.92.3.249) 0.494ms
2: 10.106.128.34 (10.106.128.34) 0.474ms
3: 10.255.32.114 (10.255.32.114) 3.658ms
4: 180.149.140.33 (180.149.140.33) 2.347ms asymm 5
5: 180.149.128.101 (180.149.128.101) 4.384ms
6: 180.149.128.113 (180.149.128.113) 7.684ms
7: 202.97.53.102 (202.97.53.102) 3.716ms asymm 8
8: 202.97.53.234 (202.97.53.234) 4.918ms asymm 9
9: 202.97.61.54 (202.97.61.54) 41.146ms
10: no reply
11: 0.ge-6-0-2-XT3.HKG2.Alter.Net (210.80.3.109) 55.096ms asymm 12
12: 0.gigabitethernet6-0-0.GW9.HKG2.Alter.Net (210.80.3.74) 38.709ms asymm 13
13: towngastelecom-gw.customer.alter.net (202.130.165.14) 44.837ms
14: 202.123.74.121 (202.123.74.121) 73.009ms asymm 15
15: 58.96.160.245 (58.96.160.245) 49.868ms asymm 14
16: 58.96.160.234 (58.96.160.234) 48.499ms
17: 58.96.160.241 (58.96.160.241) 45.385ms asymm 16
18: no reply
19: 58.96.169.52 (58.96.169.52) 47.707ms !H
Resume: pmtu 1500
[root@AY1405192126447871b3Z ~]#

[root@AY1405192126447871b3Z ~]# ping -c 8 58.96.169.52
PING 58.96.169.52 (58.96.169.52) 56(84) bytes of data.
64 bytes from 58.96.169.52: icmp_seq=1 ttl=48 time=44.8 ms
64 bytes from 58.96.169.52: icmp_seq=2 ttl=48 time=43.1 ms
64 bytes from 58.96.169.52: icmp_seq=3 ttl=48 time=42.4 ms
64 bytes from 58.96.169.52: icmp_seq=4 ttl=48 time=42.7 ms
64 bytes from 58.96.169.52: icmp_seq=5 ttl=48 time=46.6 ms
64 bytes from 58.96.169.52: icmp_seq=6 ttl=48 time=52.2 ms
64 bytes from 58.96.169.52: icmp_seq=7 ttl=48 time=44.3 ms
64 bytes from 58.96.169.52: icmp_seq=8 ttl=48 time=46.4 ms

— 58.96.169.52 ping statistics —
8 packets transmitted, 8 received, 0% packet loss, time 7057ms
rtt min/avg/max/mdev = 42.412/45.364/52.299/3.021 ms
[root@AY1405192126447871b3Z ~]#

未优化路由的路由跟踪绕道日本

[harveymei@monitor ~]$ tracepath 58.96.169.52
 1: 182.92.x.xx (182.92.x.xx) 0.115ms pmtu 1500
 1: 182.92.3.249 (182.92.3.249) 0.536ms 
 1: 182.92.3.249 (182.92.3.249) 0.697ms 
 2: 10.106.128.58 (10.106.128.58) 0.527ms 
 3: 10.255.32.110 (10.255.32.110) 1.505ms 
 4: 180.149.140.41 (180.149.140.41) 0.448ms asymm 5 
 5: 202.106.35.189 (202.106.35.189) 5.312ms 
 6: 180.149.128.9 (180.149.128.9) 3.736ms asymm 7 
 7: 202.97.53.34 (202.97.53.34) 3.659ms asymm 8 
 8: 219.158.101.34 (219.158.101.34) 5.899ms asymm 7 
 9: p64-7-0-1.r21.tokyjp05.jp.bb.gin.ntt.net (129.250.66.53) 60.465ms asymm 10 
10: ae-0.r25.tokyjp05.jp.bb.gin.ntt.net (129.250.6.200) 62.278ms asymm 11 
11: ae-8.r25.tokyjp05.jp.bb.gin.ntt.net (129.250.3.157) 50.973ms 
12: ae-1.r01.tokyjp03.jp.bb.gin.ntt.net (129.250.6.166) 124.612ms asymm 13 
13: xe-0-0-0-13.r01.tokyjp03.jp.ce.gin.ntt.net (61.213.160.222) 122.828ms asymm 14 
14: ge-1-1-0.0.pjr02.wad001.flagtel.com (85.95.26.117) 105.993ms asymm 21 
15: so-5-0-0.0.cjr04.hkg003.flagtel.com (85.95.25.214) 173.519ms asymm 18 
16: so-5-0-0.0.cjr04.hkg003.flagtel.com (85.95.25.214) 175.549ms asymm 18 
17: 80.77.0.198 (80.77.0.198) 265.257ms asymm 14 
18: 202.123.74.121 (202.123.74.121) 243.866ms asymm 13 
19: 202.123.74.121 (202.123.74.121) 239.736ms asymm 13 
20: 58.96.160.245 (58.96.160.245) 248.474ms asymm 15 
21: 58.96.169.52 (58.96.169.52) 254.868ms !H
 Resume: pmtu 1500 
[harveymei@monitor ~]$

本地台式机

root@root-desktop:~$ tracepath 58.96.169.52
1: root-desktop.local 0.125ms pmtu 1500
1: 192.168.1.254 1.021ms
1: 192.168.1.254 0.987ms
2: 183.49.125.243 1.122ms pmtu 1492
2: 183.49.124.1 5.230ms
3: 113.106.37.85 2.703ms
4: 121.15.179.54 3.779ms asymm 5
5: 121.34.242.250 9.189ms
6: 202.97.33.206 6.939ms
7: 202.97.60.70 131.812ms
8: 202.97.61.22 77.714ms
9: no reply
10: 0.ge-6-0-2-XT3.HKG2.Alter.Net 14.852ms asymm 11
11: 0.gigabitethernet6-0-0.GW9.HKG2.Alter.Net 11.380ms
12: towngastelecom-gw.customer.alter.net 18.089ms
13: 202.123.74.121 18.825ms
14: 58.96.160.245 117.302ms asymm 13
15: 58.96.160.234 18.335ms
16: 58.96.160.241 29.325ms asymm 15
17: no reply
18: 58.96.169.52 16.126ms !H
Resume: pmtu 1492
root@root-desktop:~$

 

root@root-desktop:~$ ping -c 8 58.96.169.52
PING 58.96.169.52 (58.96.169.52) 56(84) bytes of data.
64 bytes from 58.96.169.52: icmp_req=1 ttl=50 time=17.4 ms
64 bytes from 58.96.169.52: icmp_req=2 ttl=50 time=14.8 ms
64 bytes from 58.96.169.52: icmp_req=3 ttl=50 time=25.4 ms
64 bytes from 58.96.169.52: icmp_req=4 ttl=50 time=21.1 ms
64 bytes from 58.96.169.52: icmp_req=5 ttl=50 time=18.8 ms
64 bytes from 58.96.169.52: icmp_req=6 ttl=50 time=28.1 ms
64 bytes from 58.96.169.52: icmp_req=7 ttl=50 time=14.4 ms
64 bytes from 58.96.169.52: icmp_req=8 ttl=50 time=16.0 ms

— 58.96.169.52 ping statistics —
8 packets transmitted, 8 received, 0% packet loss, time 7011ms
rtt min/avg/max/mdev = 14.414/19.566/28.197/4.716 ms
root@root-desktop:~$

 

[root@VM_27_135_centos ~]# ping -c 8 58.96.169.52
PING 58.96.169.52 (58.96.169.52) 56(84) bytes of data.
64 bytes from 58.96.169.52: icmp_seq=1 ttl=45 time=16.1 ms
64 bytes from 58.96.169.52: icmp_seq=2 ttl=45 time=16.4 ms
64 bytes from 58.96.169.52: icmp_seq=3 ttl=45 time=16.9 ms
64 bytes from 58.96.169.52: icmp_seq=4 ttl=45 time=16.2 ms
64 bytes from 58.96.169.52: icmp_seq=5 ttl=45 time=20.2 ms
64 bytes from 58.96.169.52: icmp_seq=6 ttl=45 time=16.8 ms
64 bytes from 58.96.169.52: icmp_seq=7 ttl=45 time=17.8 ms
64 bytes from 58.96.169.52: icmp_seq=8 ttl=45 time=16.3 ms

— 58.96.169.52 ping statistics —
8 packets transmitted, 8 received, 0% packet loss, time 7027ms
rtt min/avg/max/mdev = 16.134/17.120/20.225/1.292 ms
[root@VM_27_135_centos ~]#

5月 192014
 

dual-nic-iptables主机A
外网IP地址:182.92.78.105
内网IP地址:10.162.220.104
主机B
内网iP地址:10.162.221.118
查看接口信息
[root@AY1405161625122035baZ ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:37:B6
inet addr:10.162.220.104 Bcast:10.162.223.255 Mask:255.255.240.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:27730 errors:0 dropped:0 overruns:0 frame:0
TX packets:4894 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1722333 (1.6 MiB) TX bytes:356206 (347.8 KiB)
Interrupt:165

eth1 Link encap:Ethernet HWaddr 00:16:3E:00:37:B7
inet addr:182.92.78.105 Bcast:182.92.79.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4147415 errors:0 dropped:0 overruns:0 frame:0
TX packets:15476 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:206913746 (197.3 MiB) TX bytes:1928149 (1.8 MiB)
Interrupt:164

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

[root@AY1405161625122035baZ ~]#

修改IP包转发
[root@AY1405161625122035baZ ~]# cat /proc/sys/net/ipv4/ip_forward
0
[root@AY1405161625122035baZ ~]# echo 1 > /proc/sys/net/ipv4/ip_forward
[root@AY1405161625122035baZ ~]# cat /proc/sys/net/ipv4/ip_forward
1
[root@AY1405161625122035baZ ~]#
[root@AY1405161625122035baZ ~]# vi /etc/rc.local
echo 1 > /proc/sys/net/ipv4/ip_forward

修改配置文件
[root@AY1405161625122035baZ ~]# vi /etc/sysctl.conf
# Controls IP packet forwarding
#net.ipv4.ip_forward = 0
net.ipv4.ip_forward = 1
将iptables加入服务启动
root@AY1405161625122035baZ ~]# chkconfig –list iptables
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@AY1405161625122035baZ ~]# chkconfig –level 35 iptables on

无法启动
[root@AY1405161625122035baZ ~]# service iptables status
iptables: Firewall is not running.
[root@AY1405161625122035baZ ~]# service iptables start
[root@AY1405161625122035baZ ~]# service iptables status
iptables: Firewall is not running.
[root@AY1405161625122035baZ ~]#
添加规则后启动
[root@AY1405161625122035baZ ~]# iptables -I INPUT -p tcp –dport 80 -j ACCEPT
[root@AY1405161625122035baZ ~]# iptables -I INPUT -p tcp –dport 22 -j ACCEPT
[root@AY1405161625122035baZ ~]# iptables -t nat -A PREROUTING -p tcp –dport 41022 -j DNAT –to-destination 10.162.221.118:22
[root@AY1405161625122035baZ ~]# iptables -t nat -A POSTROUTING -d 10.162.221.118 -p tcp –dport 22 -j SNAT –to 10.162.220.104

源地址发送数据->{PREROUTING->路由规则->POSTROUTING}->目的地址接收到数据

–table -t table table to manipulate (default: `filter’)
–append -A chain Append to chain
-d, –destination address[/mask][,…]

[root@AY1405161625122035baZ ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
[root@AY1405161625122035baZ ~]# service iptables start
iptables: Applying firewall rules: [ OK ]
[root@AY1405161625122035baZ ~]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
2 ACCEPT tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:80

Chain FORWARD (policy ACCEPT)
num target prot opt source destination

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

Table: nat
Chain PREROUTING (policy ACCEPT)
num target prot opt source destination
1 DNAT tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:41022 to:10.162.221.118:22

Chain POSTROUTING (policy ACCEPT)
num target prot opt source destination
1 SNAT tcp — 0.0.0.0/0 10.162.221.118 tcp dpt:22 to:10.162.220.104

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

[root@AY1405161625122035baZ ~]#
在内网主机上查看网络连接状态
[root@AY140518164554406132Z ~]# netstat -tun
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 232 10.162.221.118:22 10.162.220.104:53408 ESTABLISHED
tcp 0 1 10.162.221.118:44338 110.75.102.62:80 SYN_SENT
[root@AY140518164554406132Z ~]#

5月 182014
 

[root@AY140518164554406132Z ~]# cd /etc/yum.repos.d/
[root@AY140518164554406132Z ~]# mkdir backup
[root@AY140518164554406132Z ~]# mv *.repo backup/
[root@AY140518164554406132Z ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyuncs.com/repo/Centos-6.repo
[root@AY140518164554406132Z ~]# sed -i ‘s/aliyun.com/aliyuncs.com/’ /etc/yum.repos.d/CentOS-Base.repo
[root@AY140518164554406132Z ~]# yum clean all
[root@AY140518164554406132Z ~]# yum makecache