Redirect connection to a port to another port

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I have an application listening on a specific port. The port that the application listens is allowed on my home network but is sometimes blocked on other networks. I would like to have a backup port that I can use to connect back home. I will connect to the backup port and have the traffic redirected to the main port.



How would I redirect incoming traffic on the backup port to the main port?



Edit:
I tried iptables -t nat -A PREROUTING -p tcp --dport [incoming port] -j REDIRECT --to-port [main port]. Do I have to restart my machine for the changes to take?










share|improve this question























  • You may want to do this on your home router. Your router can listen to the incoming port and port forward it to the standard port. This has nothing to do with Ubuntu.
    – user68186
    Mar 23 at 16:24











  • That's a good idea.
    – Thunder-Chaser
    Mar 23 at 17:13














up vote
0
down vote

favorite












I have an application listening on a specific port. The port that the application listens is allowed on my home network but is sometimes blocked on other networks. I would like to have a backup port that I can use to connect back home. I will connect to the backup port and have the traffic redirected to the main port.



How would I redirect incoming traffic on the backup port to the main port?



Edit:
I tried iptables -t nat -A PREROUTING -p tcp --dport [incoming port] -j REDIRECT --to-port [main port]. Do I have to restart my machine for the changes to take?










share|improve this question























  • You may want to do this on your home router. Your router can listen to the incoming port and port forward it to the standard port. This has nothing to do with Ubuntu.
    – user68186
    Mar 23 at 16:24











  • That's a good idea.
    – Thunder-Chaser
    Mar 23 at 17:13












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have an application listening on a specific port. The port that the application listens is allowed on my home network but is sometimes blocked on other networks. I would like to have a backup port that I can use to connect back home. I will connect to the backup port and have the traffic redirected to the main port.



How would I redirect incoming traffic on the backup port to the main port?



Edit:
I tried iptables -t nat -A PREROUTING -p tcp --dport [incoming port] -j REDIRECT --to-port [main port]. Do I have to restart my machine for the changes to take?










share|improve this question















I have an application listening on a specific port. The port that the application listens is allowed on my home network but is sometimes blocked on other networks. I would like to have a backup port that I can use to connect back home. I will connect to the backup port and have the traffic redirected to the main port.



How would I redirect incoming traffic on the backup port to the main port?



Edit:
I tried iptables -t nat -A PREROUTING -p tcp --dport [incoming port] -j REDIRECT --to-port [main port]. Do I have to restart my machine for the changes to take?







networking iptables port-forwarding






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 16:12

























asked Mar 23 at 15:59









Thunder-Chaser

13




13











  • You may want to do this on your home router. Your router can listen to the incoming port and port forward it to the standard port. This has nothing to do with Ubuntu.
    – user68186
    Mar 23 at 16:24











  • That's a good idea.
    – Thunder-Chaser
    Mar 23 at 17:13
















  • You may want to do this on your home router. Your router can listen to the incoming port and port forward it to the standard port. This has nothing to do with Ubuntu.
    – user68186
    Mar 23 at 16:24











  • That's a good idea.
    – Thunder-Chaser
    Mar 23 at 17:13















You may want to do this on your home router. Your router can listen to the incoming port and port forward it to the standard port. This has nothing to do with Ubuntu.
– user68186
Mar 23 at 16:24





You may want to do this on your home router. Your router can listen to the incoming port and port forward it to the standard port. This has nothing to do with Ubuntu.
– user68186
Mar 23 at 16:24













That's a good idea.
– Thunder-Chaser
Mar 23 at 17:13




That's a good idea.
– Thunder-Chaser
Mar 23 at 17:13















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
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',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1018605%2fredirect-connection-to-a-port-to-another-port%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1018605%2fredirect-connection-to-a-port-to-another-port%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Which professions warranted travel in Medieval times?

Trouble downloading packages list due to a “Hash sum mismatch” error

How do so many people here on Academia.SE, and in general, afford lavish higher education programs?