Jump to content
Not connected, Your IP: 3.147.61.49
DARR1

Setting up port forwarding

Recommended Posts

ptables -I FORWARD -i tun1 -p udp -d destIP --dport port -j IP outside<<<<, correct?
iptables -I FORWARD -i tun1 -p tcp -d destIP --dport port -j IP outside<<<<<<,correct ?
iptables -t nat -I PREROUTING -i tun1 -p tcp --dport port -j DNAT --IP of local device<<<< correct ?
iptables -t nat -I PREROUTING -i tun1 -p udp --dport port -j DNAT -IP of local device<<<<<,correct ?
So all i have to do is put in those IP's and it should work ?

Share this post


Link to post

State the source from where you got these commands, please. This is highly out of context, and somewhat hints at an emerging XY problem.


NOT AN AIRVPN TEAM MEMBER. USE TICKETS FOR PROFESSIONAL SUPPORT.

LZ1's New User Guide to AirVPN « Plenty of stuff for advanced users, too!

Want to contact me directly? All relevant methods are on my About me page.

Share this post


Link to post
iptables -I FORWARD -i tun1 -p udp -d destIP --dport port -j ACCEPT
iptables -I FORWARD -i tun1 -p tcp -d destIP --dport port -j ACCEPT
iptables -t nat -I PREROUTING -i tun1 -p tcp --dport port -j DNAT --to-destination destIP
iptables -t nat -I PREROUTING -i tun1 -p udp --dport port -j DNAT --to-destination destIP

This is what i saw on here i just changed the the ends for the forums 
i have done PF before but it weren't like this

Share this post


Link to post

Is this what it should look like when i put i the ports and ip ?
iptables -I FORWARD -i tun11 -p udp -d 192.168.XX.XX--dport XXXX -j ACCEPT
iptables -I FORWARD -i tun11 -p tcp -d 192.168.XX.XX --dport XXXX -j ACCEPT
iptables -t nat -I PREROUTING -i tun11 -p tcp --dport XXXX -j DNAT --192.168.XX.XX
iptables -t nat -I PREROUTING -i tun11 -p udp --dport XXXX -j DNAT --192.168.XX.XXX

Share this post


Link to post

Okay, from the start then.

Provide a link to the exact source where you got these. State your intentions, where you want to set what up exactly. State the hardware you're trying this on, plus OS version, and paste either text configs or screenshots of it. iptables doesn't log unless told in the chain to do so, but if there's any relevant logging, even if you only think it might be relevant, provide that as well.

If you ask "are these rules correct", if someone answers, they do so under a certain layer of assumptions born from a hopeless lack of information on your part. If they are incorrect, we find ourselves in a circle of Q&As, and the actual help starts only after a whole page of posts. Please be specific in what you want help with and you will be helped. :)


NOT AN AIRVPN TEAM MEMBER. USE TICKETS FOR PROFESSIONAL SUPPORT.

LZ1's New User Guide to AirVPN « Plenty of stuff for advanced users, too!

Want to contact me directly? All relevant methods are on my About me page.

Share this post


Link to post

Splendid! So you followed the guide made by @Similiar. You're clearly referencing step 9.
Is the interface name tun11? If yes, that part is correct.
Is the port you want to forward correct? In case of a web server running on the NAS, just for example, dport would be 80, so it should be the port on which the media server listens.
 

On 3/1/2023 at 5:34 PM, DARR1 said:

ptables -I FORWARD -i tun1 -p udp -d destIP --dport port -j IP outside<<<<, correct?
iptables -I FORWARD -i tun1 -p tcp -d destIP --dport port -j IP outside<<<<<<,correct ?


Lastly, from your first post, it is clear now that these are not correct. -j is JUMP = action what to do. It can be an immediate "command" like REDIRECT, a different chain or the name of an extension like TARPIT. In the guide the two lines simply allow the traffic to actually pass, since I figure the policy is DROP to not allow any other traffic. The redirects are the other two lines; they seem correct to me.

NOT AN AIRVPN TEAM MEMBER. USE TICKETS FOR PROFESSIONAL SUPPORT.

LZ1's New User Guide to AirVPN « Plenty of stuff for advanced users, too!

Want to contact me directly? All relevant methods are on my About me page.

Share this post


Link to post

 Think i messed up in step 2..when it says add a port...which port should be added ?
The port of the Nas where the media server runs ?

Share this post


Link to post

Forward a random port and configure Plex to listen on whichever port gets assigned to you. If you cannot change it in Plex, enter the port Plex wants to listen to in the Local port field and then forward a random port. If the port forwarding on the Asus router is correct, you should be able to connect to Plex using the remote port.


NOT AN AIRVPN TEAM MEMBER. USE TICKETS FOR PROFESSIONAL SUPPORT.

LZ1's New User Guide to AirVPN « Plenty of stuff for advanced users, too!

Want to contact me directly? All relevant methods are on my About me page.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image

×
×
  • Create New...