I
I
IlliaKharytonov2017-04-17 03:24:13
Computer networks
IlliaKharytonov, 2017-04-17 03:24:13

How to redirect all HTTP requests to one address as a gateway?

I have a dhcp server and hostapd installed on my computer, and I want to redirect all http (s) requests from clients to a local address (to myself) in order to show a stub page. This is how it didn't work:

/sbin/iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.1.1

How can this be done? Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Fedoseev, 2017-04-17
@IlliaKharytonov

use REDIRECT instead of DNAT
https://serverfault.com/questions/179200/differenc...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question