In order to enable both Unicom and telecommunications users to quickly access the website, the company's servers are hosted in a two-line dual IP room. The server uses two-line dual ip to do some special configuration on the routing table. The solution provided by IDC is to fill in the static routing table. The method is to use the telecommunication gateway as the default route, and then manually fill in the routing rules of all Netcom IP address segments.
This method has a lot of drawbacks:
1. Adding too many rules is too much trouble. If you miss some network segments, users of these network segments will not be able to access the website.
2, dns intelligent resolution of the way and fill in the static routing network segment is different, users will not be able to access our website.
3, the distribution of network segment addresses is always changing, the routing table must be updated regularly.
Solution:
Use dynamic routing to set up dynamic routing based on the user's incoming path. If the user accesses through the telecom IP address, then use the telecom gateway to do routing and return. The content goes to the telecommunication gateway; if the user accesses through the Unicom IP address, then the Unicom gateway is used for routing, and the content is returned to the gateway of China Unicom.
After testing on the website backup server, the dynamic routing table method can solve the shortcomings of the static routing table.
The specific method is as follows:
If the server assigns the ip address as follows
Telecom Gateway: 59.83.100.1; Telecom ip: 59.83.100.10.
Unicom Gateway: 221.214.100.1; Unicom ip: 221.214.100.10.
1. Edit the rt_tables file and add the telecom connection path from the table
- # vi /etc/iproute2/rt_tables # (Increase the two routing tables of Telecom and China Unicom
Adding a Telecommunication Linkage by
- 252 tel
- 251 cnc
2, Edit rc The .local file sets the telecommunications and network access by the table contents.
- # vi /etc/rc.d/rc.local #(Setting the telecommunications and network access by table contents)
Add
- ip route replace default via 59.83.100.1 dev eth0 #default route line
- ip route flush table tel #refresh tel routing table
- Ip route add default via 59.83.100.1 dev eth0 src 59.83.100.10 table tel #add loopback address
- ip rule add from 59.83.100.10 table tel #from 59.83.100.10, go tel route
< Li> ip route flush table cnc # refresh cnc routing table
- ip route add default via 221.214.100.1 dev eth1 src 221.214.100.10 table cnc
- ip rule add from 221.214.100.10 table cnc # Take the cnc route from 221.214.100.10
reboot the server test effect!
1 U disk or disk mount under virtual machine, network configuration under Ubuntu, switch bet
How Linux extends the XFS file system. There is extra space on the disk, so I want to extend the exi
using direct-lvm storage method Recently played docker on Bluemix virtual machine, but found that t
First find the iptables file Generally under /etc/sysconfig Then vi iptables Just like add
Linux network based network IP notes
Linxu SSH login appears Access Denied error solution
Ssh-remote login centos7070 port
Linux kernel design and implementation - kernel synchronization
Setting up a firewall whitelist under Linux (RHEL 6 and CentOS 7)
U-Boot first phase key code understanding
The difference between the chown and chmod commands in Linux
Linux system Vsftp transfer files appear 553 Could Not Create File error solution
Linux view and terminate process
Win10 Tips: Win10 Taskbar QQ Icon Flat Beautification Tutorial
10 most popular Win8 apps from foreigners
How to change Lenovo notebook win8 into win7 tutorial
Win7 computer inserts a USB flash drive to the blue screen processing solution
Win10 SDK Preview comes with Build 10166
Windows 8.1 system version number view method
Teach you to open Win7 Home Basic Edition all Aero effects
u disk installation linux experience
Zombie Besieged City 1 mixed food effect What is the effect of Zombie Besieged mixed food effect
What should I do if I can't find the uninstaller in the win7 start menu?