Redirect all traffic to one page on webserver Raspberry PI AP

Multi tool use
I am currently trying to get iptables working on my Raspberry PI. But for some reason they won't work. This is the content of my /etc/iptables/rules.v4 file.
Generated by iptables-save v1.6.0 on Wed Dec 5 20:31:17 2018
*filter
:INPUT ACCEPT [2002:172481]
:FORWARD ACCEPT [19049:10551754]
:OUTPUT ACCEPT [4062:4987223]
COMMIT
# Completed on Wed Dec 5 20:31:17 2018
# Generated by iptables-save v1.6.0 on Wed Dec 5 20:31:17 2018
*nat
:PREROUTING ACCEPT [61:17238]
:INPUT ACCEPT [24:1932]
:OUTPUT ACCEPT [28:1879]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.2.25:8080
-A PREROUTING -p tcp -m tcp --dport 433 -j DNAT --to-destination 192.168.2.25:8080
-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -j MASQUERADE
COMMIT
# Completed on Wed Dec 5 20:31:17 2018
I have persistent iptables installed, On boot this file is already filled with this content.At this very moment i don't have an active internet connection but that shouldn't matter i think. It should trigger this pop up regardless (right?) The website is on my raspberry pi, it is an java servlet website running on apache2 and tomcat.
What i am trying to achieve is the following.
When you connect to the hotspot it needs to pop up a login screen, or atleast trigger the login screen whenever someone tries to make connection with the internet.
Pi information:
~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
Running sudo rpi-update does not help, i've seen this as a possible fix but i can't seem to get it working. Also i want to create this captive portal using no software as Splash page
linux networking iptables raspberry-pi
add a comment |
I am currently trying to get iptables working on my Raspberry PI. But for some reason they won't work. This is the content of my /etc/iptables/rules.v4 file.
Generated by iptables-save v1.6.0 on Wed Dec 5 20:31:17 2018
*filter
:INPUT ACCEPT [2002:172481]
:FORWARD ACCEPT [19049:10551754]
:OUTPUT ACCEPT [4062:4987223]
COMMIT
# Completed on Wed Dec 5 20:31:17 2018
# Generated by iptables-save v1.6.0 on Wed Dec 5 20:31:17 2018
*nat
:PREROUTING ACCEPT [61:17238]
:INPUT ACCEPT [24:1932]
:OUTPUT ACCEPT [28:1879]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.2.25:8080
-A PREROUTING -p tcp -m tcp --dport 433 -j DNAT --to-destination 192.168.2.25:8080
-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -j MASQUERADE
COMMIT
# Completed on Wed Dec 5 20:31:17 2018
I have persistent iptables installed, On boot this file is already filled with this content.At this very moment i don't have an active internet connection but that shouldn't matter i think. It should trigger this pop up regardless (right?) The website is on my raspberry pi, it is an java servlet website running on apache2 and tomcat.
What i am trying to achieve is the following.
When you connect to the hotspot it needs to pop up a login screen, or atleast trigger the login screen whenever someone tries to make connection with the internet.
Pi information:
~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
Running sudo rpi-update does not help, i've seen this as a possible fix but i can't seem to get it working. Also i want to create this captive portal using no software as Splash page
linux networking iptables raspberry-pi
add a comment |
I am currently trying to get iptables working on my Raspberry PI. But for some reason they won't work. This is the content of my /etc/iptables/rules.v4 file.
Generated by iptables-save v1.6.0 on Wed Dec 5 20:31:17 2018
*filter
:INPUT ACCEPT [2002:172481]
:FORWARD ACCEPT [19049:10551754]
:OUTPUT ACCEPT [4062:4987223]
COMMIT
# Completed on Wed Dec 5 20:31:17 2018
# Generated by iptables-save v1.6.0 on Wed Dec 5 20:31:17 2018
*nat
:PREROUTING ACCEPT [61:17238]
:INPUT ACCEPT [24:1932]
:OUTPUT ACCEPT [28:1879]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.2.25:8080
-A PREROUTING -p tcp -m tcp --dport 433 -j DNAT --to-destination 192.168.2.25:8080
-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -j MASQUERADE
COMMIT
# Completed on Wed Dec 5 20:31:17 2018
I have persistent iptables installed, On boot this file is already filled with this content.At this very moment i don't have an active internet connection but that shouldn't matter i think. It should trigger this pop up regardless (right?) The website is on my raspberry pi, it is an java servlet website running on apache2 and tomcat.
What i am trying to achieve is the following.
When you connect to the hotspot it needs to pop up a login screen, or atleast trigger the login screen whenever someone tries to make connection with the internet.
Pi information:
~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
Running sudo rpi-update does not help, i've seen this as a possible fix but i can't seem to get it working. Also i want to create this captive portal using no software as Splash page
linux networking iptables raspberry-pi
I am currently trying to get iptables working on my Raspberry PI. But for some reason they won't work. This is the content of my /etc/iptables/rules.v4 file.
Generated by iptables-save v1.6.0 on Wed Dec 5 20:31:17 2018
*filter
:INPUT ACCEPT [2002:172481]
:FORWARD ACCEPT [19049:10551754]
:OUTPUT ACCEPT [4062:4987223]
COMMIT
# Completed on Wed Dec 5 20:31:17 2018
# Generated by iptables-save v1.6.0 on Wed Dec 5 20:31:17 2018
*nat
:PREROUTING ACCEPT [61:17238]
:INPUT ACCEPT [24:1932]
:OUTPUT ACCEPT [28:1879]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.2.25:8080
-A PREROUTING -p tcp -m tcp --dport 433 -j DNAT --to-destination 192.168.2.25:8080
-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -j MASQUERADE
COMMIT
# Completed on Wed Dec 5 20:31:17 2018
I have persistent iptables installed, On boot this file is already filled with this content.At this very moment i don't have an active internet connection but that shouldn't matter i think. It should trigger this pop up regardless (right?) The website is on my raspberry pi, it is an java servlet website running on apache2 and tomcat.
What i am trying to achieve is the following.
When you connect to the hotspot it needs to pop up a login screen, or atleast trigger the login screen whenever someone tries to make connection with the internet.
Pi information:
~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
Running sudo rpi-update does not help, i've seen this as a possible fix but i can't seem to get it working. Also i want to create this captive portal using no software as Splash page
linux networking iptables raspberry-pi
linux networking iptables raspberry-pi
edited Dec 11 at 11:36
asked Dec 11 at 8:50
user7329477
12
12
add a comment |
add a comment |
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1382562%2fredirect-all-traffic-to-one-page-on-webserver-raspberry-pi-ap%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1382562%2fredirect-all-traffic-to-one-page-on-webserver-raspberry-pi-ap%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
BzEMvFsDFQfp9p,LL2aYId48uVc,P2VfPWr,ILf8t3dQkzezCs1H4ukav8Nullr