About getting the carrier's IP address
Currently, ISP providers in China mainly include China Telecom, China Netcom (now connected with the Internet), and China Mobile (already merged with China tietong). The largest ISP is China Telecom and China Unicom (China Netcom ). Due to the differences between ISPs in the South and the North, ISP restrictions lead to slow access to various websites in the South and North. To solve this problem, the common practice is to obtain the IP address segment of the carrier. By setting dual-line (multi-line) DNS access, "China Telecom takes China Telecom and China Netcom takes China Telecom" to solve the problem.
1. Download and compile software
# Wget http://ftp.apnic.net/apnic/dbase/tools/ripe-dbase-client-v3.tar.gz
# Tar xzvf ripe-dbase-client-v3.tar.gz
# Cd whois-3.1
#./Configure
# Make
# Make install
2. Obtain the IP address Library of China Netcom
./Whois3-h whois.apnic.net-l-I mb MAINT-CNCGROUP-RR> data/cnc-rr
3. Obtain China Telecom's IP address Library
./Whois3-h whois.apnic.net-l-I mb MAINT-CHINANET> data/chinanet
4. Get China tietong
./Whois3-h whois.apnic.net-l-I mb MAINT-CN-CRTC> data/crtc
5. format the Netcom address;
Cat data/cnc-rr | grep route | sed's/route: // G' | sed's/. // G'