Go Back   TechArena Community > Technology > Networking & Security
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Cannot do Port forwarding in Debian Linux

Networking & Security


Reply
 
Thread Tools Search this Thread
  #1  
Old 26-02-2012
Member
 
Join Date: Jan 2012
Posts: 96
Cannot do Port forwarding in Debian Linux
  

Currently I have a computer which is connected to the internet (via ppp0) and dhcp server (via eth0) (Debian 6.0.3). The dhcp server IP address is 192.168.2.1. On the other hand I have another computer which is also connected to the server with IP: 192.168.2.167. I want to do port forwarding from the internal port 16000 of the 192.168.2.167 to the external port 13201 which is of ppp0. I tried the iptables command meant for this operating in Debian but nmap can't see port 13201 opened. Does anyone know why it is not do port forwarding.

Reply With Quote
  #2  
Old 26-02-2012
Member
 
Join Date: Jun 2011
Posts: 452
Re: Cannot do Port forwarding in Debian Linux

First of all you have to check the sysctl (sysctl -a) to see if port forwarding is enabled on bootup. iptables is NOT a firewall. It is a tool named netfilter that lets you configure the firewall for Linux. netfilter is included in the kernel. By default no filtering is active. A port cannot be opened if a service does not listen on that port. In this case you try to log in, probably has a web server on your local address (127.0.0.1). Verify that a server listens on by one:

Code:
 netstat-laptn
Reply With Quote
  #3  
Old 26-02-2012
Member
 
Join Date: May 2011
Posts: 231
Re: Cannot do Port forwarding in Debian Linux

First of all I thought that you are looking for to send the traffic to 192.168.2.167, not 192.168.2.107.
Code:
iptables -A PREROUTING -t nat -i ppp0 -p tcp --dport 13201 -j DNAT --to 192.168.2.167:16000
iptables -A FORWARD -p tcp -d 192.168.2.167 --dport 16000 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
I think that for your case an open ACCEPT rule would work as well.
Reply With Quote
  #4  
Old 26-02-2012
Member
 
Join Date: May 2011
Posts: 443
Re: Cannot do Port forwarding in Debian Linux

If you modify the destination address of the packet, and that this address is not that of your firewall, then your package will be processed by the FORWARD chain, not INPUT.
Reply With Quote
  #5  
Old 26-02-2012
Member
 
Join Date: May 2011
Posts: 425
Re: Cannot do Port forwarding in Debian Linux

The port knocking is a very interesting way to enable access to various services (classic sshd for example) without having to always keep the door open on the firewall. An additional security measure very efficient with low running costs and virtually no claim against. We assume you have a firewall on our server based on IPTABLES with all doors closed, and we need to be accessed remotely via ssh. The road we want to avoid is to use port forwarding on the firewall by opening the door and forwarding it to the server or open the door of the sshd service directly.
Reply With Quote
  #6  
Old 26-02-2012
Member
 
Join Date: Mar 2011
Posts: 440
Re: Cannot do Port forwarding in Debian Linux

To make sure that the firewall "external" to redirect requests to the / server in the DMZ, there is a mechanism called "port forwarding", which by the external firewall receives the incoming communication to a port with a specific transport protocol, and the "bounces" back to the server in the DMZ with the same transport protocol and on a door which is often identical to that of the original request, but which can also change.
Reply With Quote
  #7  
Old 01-03-2012
Member
 
Join Date: Feb 2010
Posts: 428
Re: Cannot do Port forwarding in Debian Linux

The thing to consider when you configure the port forwarding, which is the default behavior on the FORWARD chain is blocking traffic, so along education necessary to indicate the redirection true, it is necessary to set a rule of FORWARD which enables the traffic from the external interface (eth1) to the DMZ only for the type of request necessary.
Reply With Quote
Reply

  TechArena Community > Technology > Networking & Security
Tags: , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Cannot do Port forwarding in Debian Linux"
Thread Thread Starter Forum Replies Last Post
Which port should I use for port forwarding in Dungeon Defenders? Riley01 Video Games 4 29-10-2011 09:15 AM
Unable to do Nat port forwarding in VMware player in Linux (centos 5) Emiliana Windows Software 10 15-09-2011 10:29 PM
How to do port forwarding in weird Linksys WRT54G at port 80 and 443? HamsiniI Networking & Security 5 02-07-2011 05:00 AM
Port Forwarding on Mac OS X TalinF Networking & Security 9 25-06-2010 07:12 AM
Port Forwarding Help Please. Zelos37 Networking & Security 6 20-01-2009 09:03 PM


All times are GMT +5.5. The time now is 01:59 PM.