Forum Thread: How to Enable Port-Forwarding

Hey everyone,

I wanted to know how to enable port-forwarding in Kali linux (I want to use my public IP address for reverse-tcp connection in metasploit exploits).

Join the Next Reality AR Community

Get the latest in AR — delivered straight to your inbox.

14 Responses

you mean he should set it to 192.168.X.X ?

and, another question:
when i set my LPORT to 8080,i should forward port 8080 in my router?

Ports are forwarded to internal IP. Payloads should use public IP.

The incoming connection from the payload needs to know the public IP to connect back to the listener (because the exploit and the listener might be on two different computers) and the port, that NAT then resolves into an internal IP. Router remembers which computer in the LAN is listening the incoming connection and initializes it. I'm pretty sure it is like this, after my recent studies about networking, so if you have evidence that I'm wrong, please correct me.

OK,so i have opened port 8080 and 4444 on my router (here's the screen-shot)

Image via

but i still can't bind a reverse-tcp connection. what is the problem? should i configure Linux?

1.yeah, I checked that in ifconfig
2.interesting,im working on it...

here's a Screen-Shot of the metasploit settings:

Image via

Well, it waits for 180 secs but nothing happens
(Im shure that the Remote computer IS vulnerable.)


by the way, there is another option in my router settings named "Port-Triggering". Won't that help?

Is there any difference in port forwarding when using kali as vm and kali as only or host OS?

I've noticed its easier to access the public IP through a cloud VM than it is on a local VM, something like vmware.

you can do either of the 2 but it's always better to practise and learn first using a vm for any activity as you dont want to break any actual computers. It works exactly the same with the only difference being in a vm you can connecct to a virtual network ( like a NAT N/W).

can i do that without router thx

You need access to the router to port forward.

Share Your Thoughts

  • Hot
  • Active