Redirect - IPtables
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I want to be redirected to page 192.168.1.1
when the user enters the www.google.com
site.
So I add the following iptables
rules on the router:
iptables -t nat -I PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.1.1:80
iptables -t nat -I PREROUTING -p tcp --dport 443 -j DNAT --to-destination 192.168.1.1:80
iptables -t nat -I OUTPUT -p tcp --dport 80 -j DNAT --to-destination 192.168.1.1:80
iptables -t nat -I OUTPUT -p tcp --dport 443 -j DNAT --to-destination 192.168.1.1:80
But it does not work properly.
When the user enters the Yahoo site, it is redirected to page 192.168.1.1
as expected
But when the user enters the Google site, they are not redirected to page 192.168.1.1
Also, when the user enters the connectivitycheck.gstatic.com/generate_204
site :
Not Found
the requested url /generate_204 was not found on this
server
Can anyone suggest why this isn't working?
iptables
add a comment |Â
up vote
0
down vote
favorite
I want to be redirected to page 192.168.1.1
when the user enters the www.google.com
site.
So I add the following iptables
rules on the router:
iptables -t nat -I PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.1.1:80
iptables -t nat -I PREROUTING -p tcp --dport 443 -j DNAT --to-destination 192.168.1.1:80
iptables -t nat -I OUTPUT -p tcp --dport 80 -j DNAT --to-destination 192.168.1.1:80
iptables -t nat -I OUTPUT -p tcp --dport 443 -j DNAT --to-destination 192.168.1.1:80
But it does not work properly.
When the user enters the Yahoo site, it is redirected to page 192.168.1.1
as expected
But when the user enters the Google site, they are not redirected to page 192.168.1.1
Also, when the user enters the connectivitycheck.gstatic.com/generate_204
site :
Not Found
the requested url /generate_204 was not found on this
server
Can anyone suggest why this isn't working?
iptables
1
Redirecting HTTPS traffic to port 80 will fail because the browser expects to "talk" SSL but gets plain HTTP, which probably explains your google fail. As for the generate_204 thing, do you have that on your server on 192.168.1.1? If not, why are you surprised to get a 404?
â wurtel
Sep 25 at 8:58
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to be redirected to page 192.168.1.1
when the user enters the www.google.com
site.
So I add the following iptables
rules on the router:
iptables -t nat -I PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.1.1:80
iptables -t nat -I PREROUTING -p tcp --dport 443 -j DNAT --to-destination 192.168.1.1:80
iptables -t nat -I OUTPUT -p tcp --dport 80 -j DNAT --to-destination 192.168.1.1:80
iptables -t nat -I OUTPUT -p tcp --dport 443 -j DNAT --to-destination 192.168.1.1:80
But it does not work properly.
When the user enters the Yahoo site, it is redirected to page 192.168.1.1
as expected
But when the user enters the Google site, they are not redirected to page 192.168.1.1
Also, when the user enters the connectivitycheck.gstatic.com/generate_204
site :
Not Found
the requested url /generate_204 was not found on this
server
Can anyone suggest why this isn't working?
iptables
I want to be redirected to page 192.168.1.1
when the user enters the www.google.com
site.
So I add the following iptables
rules on the router:
iptables -t nat -I PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.1.1:80
iptables -t nat -I PREROUTING -p tcp --dport 443 -j DNAT --to-destination 192.168.1.1:80
iptables -t nat -I OUTPUT -p tcp --dport 80 -j DNAT --to-destination 192.168.1.1:80
iptables -t nat -I OUTPUT -p tcp --dport 443 -j DNAT --to-destination 192.168.1.1:80
But it does not work properly.
When the user enters the Yahoo site, it is redirected to page 192.168.1.1
as expected
But when the user enters the Google site, they are not redirected to page 192.168.1.1
Also, when the user enters the connectivitycheck.gstatic.com/generate_204
site :
Not Found
the requested url /generate_204 was not found on this
server
Can anyone suggest why this isn't working?
iptables
iptables
edited Sep 25 at 8:53
RobotJohnny
708216
708216
asked Sep 25 at 8:08
Minion
11
11
1
Redirecting HTTPS traffic to port 80 will fail because the browser expects to "talk" SSL but gets plain HTTP, which probably explains your google fail. As for the generate_204 thing, do you have that on your server on 192.168.1.1? If not, why are you surprised to get a 404?
â wurtel
Sep 25 at 8:58
add a comment |Â
1
Redirecting HTTPS traffic to port 80 will fail because the browser expects to "talk" SSL but gets plain HTTP, which probably explains your google fail. As for the generate_204 thing, do you have that on your server on 192.168.1.1? If not, why are you surprised to get a 404?
â wurtel
Sep 25 at 8:58
1
1
Redirecting HTTPS traffic to port 80 will fail because the browser expects to "talk" SSL but gets plain HTTP, which probably explains your google fail. As for the generate_204 thing, do you have that on your server on 192.168.1.1? If not, why are you surprised to get a 404?
â wurtel
Sep 25 at 8:58
Redirecting HTTPS traffic to port 80 will fail because the browser expects to "talk" SSL but gets plain HTTP, which probably explains your google fail. As for the generate_204 thing, do you have that on your server on 192.168.1.1? If not, why are you surprised to get a 404?
â wurtel
Sep 25 at 8:58
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f471256%2fredirect-iptables%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Redirecting HTTPS traffic to port 80 will fail because the browser expects to "talk" SSL but gets plain HTTP, which probably explains your google fail. As for the generate_204 thing, do you have that on your server on 192.168.1.1? If not, why are you surprised to get a 404?
â wurtel
Sep 25 at 8:58