Today, the MacBook for the company is configured with VPN, but every time dial-up everyone QQ and Skype will be off the line, and many people connected to the VPN, towed the company's speed, in order to solve such problems, I did a VPN, visit the domestic web site does not go VPN, visit abroad to go VPN, In order for the company's MacBook to be updated to the routing table in real time, I did one of the following simple things.
1. Download routing table
Because to get to the routing table to be updated for everyone, but the routing table to get the site:
Chnroutes home: https://code.google.com/p/chnroutes/, streaming routing table download: http://chnroutes-dl.appspot.com/, the two sites are "special care" at home, So there are 404, reset and so on don't feel strange. Connect to VPN or use Web page proxy access.
So I can only put down the routing table on a foreign server:
The code is as follows |
Copy Code |
wget http://chnroutes-dl.appspot.com/downloads/AMIfv95TJD_ Eme3fftmpe7ydli6pirkyrchtrczjrum-vlg6q-xyqvdkvzbdqd7pi1i3oq3tp1bhenh1rpyca-5qef22tgpell6wtr6_ Vxcpazn5eeivjeg-eqaemsucqmlatvz8kbkbq-nskf1yg5vv6m7nqngwbmlt2up1lr241ludosofqhi |
2. Down, get linuxzip.zip This package, we're going to unpack
The code is as follows |
Copy Code |
Yum-y Install Unzip Unzip Linuxzip.zip
|
Unpack it out there
Data folders and install.sh files
We go into the Data folder and we want to get the routing table in the ip-pre-up file, using the following command:
The code is as follows |
Copy Code |
awk '/route/,p ' ip-pre-up >ip1
|
This will be the IP routing table extracted, but the contents are as follows:
The code is as follows |
Copy Code |
Route add 1.0.1.0/24 "${OLDGW}" Route add 1.0.2.0/23 "${OLDGW}" Route add 1.0.8.0/21 "${OLDGW}" Route add 1.0.32.0/19 "${OLDGW}" Route add 1.1.0.0/24 "${OLDGW}" Route add 1.1.2.0/23 "${OLDGW}" Route add 1.1.4.0/22 "${OLDGW}" Route add 1.1.8.0/21 "${OLDGW}" Route add 1.1.16.0/20 "${OLDGW}" Route add 1.1.32.0/19 "${OLDGW}" Route add 1.2.0.0/23 "${OLDGW}" Route add 1.2.2.0/24 "${OLDGW}" Route add 1.2.4.0/24 "${OLDGW}" Route add 1.2.5.0/24 "${OLDGW}" Route add 1.2.6.0/23 "${OLDGW}" Route add 1.2.8.0/24 "${OLDGW}" Route add 1.2.9.0/24 "${OLDGW}" Route add 1.2.10.0/23 "${OLDGW}" Route add 1.2.12.0/22 "${OLDGW}" Route add 1.2.16.0/20 "${OLDGW}" Route add 1.2.32.0/19 "${OLDGW}" Route add 1.2.64.0/18 "${OLDGW}" Route add 1.3.0.0/16 "${OLDGW}" ........ (I omitted a lot of the middle) Route add 103.252.64.0/22 "${OLDGW}" Route add 103.252.104.0/22 "${OLDGW}" Route add 103.252.172.0/22 "${OLDGW}" Route add 103.252.204.0/22 "${OLDGW}" Route add 103.252.208.0/22 "${OLDGW}" Route add 103.252.232.0/22 "${OLDGW}" Route add 103.252.248.0/22 "${OLDGW}" Route add 103.253.4.0/22 "${OLDGW}" Route add 103.253.60.0/22 "${OLDGW}" |
So we're going to come to the last step to put forward the routing table, and none of the others:
The code is as follows |
Copy Code |
Sed '/./{s/^route add//;s/' ${OLDGW} '//} ' ip1 >t1.txt Sed '/./{s/^[t]*//;s/[t]*$//} ' t1.txt >ip |
This is really the IP routing table extracted.