Rewriting destination ip address
If you changed your server's ip address and all the configurations of services (apache, dns etc.) you can think about that new requests always comes to your new ip address but it doesn't. Due to the non-sdandard dns caching issues, some of the users still try to connect your old ip address. If you have both of the old ip and new ip working and configured on your server, you can get that connections. But some services can be rely on the specific ip (for example if all the virtual hosts in apache configured for new ip address) to work correctly.
To solve this problem, we can use iptable's NETMAP target to rewrite destination address of incoming packets. This should be done in PREROUTING chain of nat table as below:
iptables -t nat -A PREROUTING -p tcp -d OLD_IP --dport 80 -j NETMAP --to NEW_IP
Above example change all of the destination ip address to NEW_IP on icoming request which is a tcp connection, has destination port of 80 and destination ip of OLD_IP
- 0 Comment
- Murat Demirten
- 19 Feb 2009, 13:02
-
You must be login first or sign-up for an account to post comments.
Maybe you should look at these also:
USERBOX
CATEGORIES
MOST READ TODAY
- Booting from an ISO image using qemu
- Rewriting destination ip address
- Syntax highlighting in less
- Recursively mput with smbclient
- Disabling reverse dns lookups in ssh
- XFS Filesystem has duplicate UUID problem
- Enabling remote desktop on a VirtualBox Machine
- Remove all frozen messages from exim mail queue
- Users with /bin/false shell to login on vsftpd
- Routing packets back from incoming interface
LAST ADDED
- Using iPhone internet sharing over bluetooth under Linux
- Using USB sound card with amarok
- Multi-conditional search and replace (clearing a ftp trojan script example)
- Disabling ipv6 functionality
- How to convert a mp3 file
- How to choose the fastest Debian mirror
- Disabling reverse dns lookups in ssh
- Rewriting destination ip address
- Deleting A File By It's Inode Value
- Learning which libraries are used for a binary
