I want to redirect all the incoming requests to an URL instead of an IP address how can i archive this.. And when I redirect using IP address the redirection is happening but the redirected IP/URL is not shown in the browser address bar.. how to change this?..
The following are the rules i'm setting,
echo "1" > /proc/sys/net/ipv4/ip_forward
ebtables -t nat -N GUEST
ebtables -t nat -A PREROUTING -i eth0 -j GUEST
ebtables -t nat -N GUEST-REDIRECT
ebtables -t nat -A GUEST-REDIRECT -j mark --mark-set 1 --mark-target CONTINUE
ebtables -t nat -A GUEST-REDIRECT -j redirect
ebtables -t nat -A GUEST -p 0x800 --pkttype-type otherhost --ip-proto 6 --ip-dport 80 -j GUEST-REDIRECT
iptables -t nat -A PREROUTING -p tcp -m mark --mark 1 -j DNAT --to-destination 172.40.1.0
iptables -t nat -A POSTROUTING -j MASQUERADE
The clients are redirected to the IP 172.40.1.0. but what i want is to redirect the request to a URL[ example: www.facebook.com/user ].
When I use the above rules the clients are redirected to the IP 172.40.1.0 but in the address bar of the browser its still showing the requested URL not the redirected one.