Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Port Forwarding
New on LowEndTalk? Please Register and read our Community Rules.

Port Forwarding

hallo, i need some help about port forwarding

i have
vps ubuntu 18 64 bit
ip vps 103.253.27.165
ip local vpn 10.255.255.34
port 7575

i want forward to my router
ip router 192.168.17.1
port 8282

what is the command should i type on my server to forward port 7575 to 8282

:smile:

Comments

  • miHoYomiHoYo Member

    You need a vpn connection between the server and home to keep the client's IP.

  • yes vpn already running > @miHoYo said:

    You need a vpn connection between the server and home to keep the client's IP.

    yes, vpn already running sir

  • Do you need to tunnel protocols other than TCP? Because if not you can just use SSH Remote Port Forwarding.

    Anyhoo, this should be pretty straightforward considering you already have the VPN set up, take a look at this.

    Thanked by 1darkimmortal
  • chipchip Member

    Sorry I'm struggling to follow.... you have a vpn and a vps and then there is an ip address at your house (lan ip 192.x.x.x) port forwarding from your internal lan to the Internet is easy and you can change the external port so internal can be 7575 and external can be 8282

    Unless that's not what your trying to achieve

  • miHoYomiHoYo Member

    on ubuntu box
    iptables -t nat -A PREROUTING -p tcp -m tcp -i ens33 --dport 7575 -j DNAT --to-destination 10.255.255.35:8282

    will packet oging to your home..

    uhm.. i don't know your home's vpn ip

  • edited January 3

    @rinalarnando said:
    hallo, i need some help about port forwarding

    i have
    vps ubuntu 18 64 bit
    ip vps 103.253.27.165
    ip local vpn 10.255.255.34
    port 7575

    i want forward to my router
    ip router 192.168.17.1
    port 8282

    what is the command should i type on my server to forward port 7575 to 8282

    :smile:

    iptables -t nat -A PREROUTING -p tcp --dport 7575 -j DNAT --to-destination RouterIPviaVPN:8282
    
    iptables -t nat -A POSTROUTING -j MASQUERADE
    
  • @miHoYo said:
    on ubuntu box
    iptables -t nat -A PREROUTING -p tcp -m tcp -i ens33 --dport 7575 -j DNAT --to-destination 10.255.255.35:8282

    will packet oging to your home..

    uhm.. i don't know your home's vpn ip

    what is differrent your ways with mr t0ny0's ?

    @t0ny0 said:

    @rinalarnando said:
    hallo, i need some help about port forwarding

    i have
    vps ubuntu 18 64 bit
    ip vps 103.253.27.165
    ip local vpn 10.255.255.34
    port 7575

    i want forward to my router
    ip router 192.168.17.1
    port 8282

    what is the command should i type on my server to forward port 7575 to 8282

    :smile:

    iptables -t nat -A PREROUTING -p tcp --dport 7575 -j DNAT --to-destination RouterIPviaVPN:8282
    
    iptables -t nat -A POSTROUTING -j MASQUERADE
    
  • miHoYomiHoYo Member

    @rinalarnando said:

    @miHoYo said:
    on ubuntu box
    iptables -t nat -A PREROUTING -p tcp -m tcp -i ens33 --dport 7575 -j DNAT --to-destination 10.255.255.35:8282

    will packet oging to your home..

    uhm.. i don't know your home's vpn ip

    what is differrent your ways with mr t0ny0's ?

    @t0ny0 said:

    @rinalarnando said:
    hallo, i need some help about port forwarding

    i have
    vps ubuntu 18 64 bit
    ip vps 103.253.27.165
    ip local vpn 10.255.255.34
    port 7575

    i want forward to my router
    ip router 192.168.17.1
    port 8282

    what is the command should i type on my server to forward port 7575 to 8282

    :smile:

    iptables -t nat -A PREROUTING -p tcp --dport 7575 -j DNAT --to-destination RouterIPviaVPN:8282
    
    iptables -t nat -A POSTROUTING -j MASQUERADE
    

    you don't need Masquerade line because it's source nat.

Sign In or Register to comment.