K
K
kirill3612015-03-07 00:40:18
iptables
kirill361, 2015-03-07 00:40:18

How to auto-redirect to a website using a router?

Tell me how to redirect to another site in the router? That is, for the user to go to the site example1.ru, and the site example2.ru opens for him. As I understand it, this should be done through iptables, but I don’t know how to do it. Help me please!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kirill361, 2015-03-07
@kirill361

I found how to do
iptables -t nat -A PREROUTING -d 10.10.10.10 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.1.1:80
iptables -t nat -A POSTROUTING -d 192.168. 1.1 -p tcp -m tcp -dport 80 -j SNAT --to-source
10.10.10.10 .
instead of these apmshnikov, we put the ip of the sites (the ip of the site can be found in Google)
Save the rules so as not to lose them on the next reboot:
iptables-save
iptables-save > /etc/sysconfig/iptables

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question