LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-04-2011, 04:38 PM   #1
gadhave.vikas
LQ Newbie
 
Registered: May 2009
Location: Navi Mumbai (Maharashtra)
Distribution: Dont Know
Posts: 22

Rep: Reputation: 0
need to open port number 7 on debian linux


Hi Techies,

I have system with debian linux installed. i got to know that debian doesent have IPTABLES firewall installed in built. i found the shoerwall firewall installed on system. now i wanted to open port no.7 for application comunication purpose please let me know if any one knows.

also one more thing.. if i type command iptables --list i can see list of rules installed on ssytem....confuse which firewall application installed on the system please advice.......

Rgds,
vikas
 
Old 05-04-2011, 04:44 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005
Hello,

If you can run iptables --list then iptables is installed. You could use shorewall to open the port, or you can edit /etc/sysconfig/iptables manually and add a rule to open port 7 on your system. See here for more documentation on iptables and adding rules: http://www.linuxhomenetworking.com/w...Using_iptables
ALso, see here about adding rules in shorewall: http://www.shorewall.net/FAQ.htm#faq51

Also, the following rule will open port 7, TCP:
Code:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 7 -j ACCEPT
Hope that helps,

Josh
 
Old 05-04-2011, 09:35 PM   #3
gadhave.vikas
LQ Newbie
 
Registered: May 2009
Location: Navi Mumbai (Maharashtra)
Distribution: Dont Know
Posts: 22

Original Poster
Rep: Reputation: 0
need to open port number 7 on debian linux

Thx josh,

As you have stated that the i can use manually /etc/sysconfig/iptables but there on system I failed to find the sysconfig directory in etc.
I have check with find command iptabes file pls find the below output.
find / -name iptables
/sbin/iptables
/usr/share/doc/iptables
/usr/share/lintian/overrides/iptables
/usr/share/iptables

Also I have to use UDP protocol instead of TCP. (pls suggest the rule as per)
What you have given website about shoerwall that is not usable for me as I have go through with the site already. But my problem is if I consider website shoerwall there are lots of dependency to open port which I cannot full fill because I don’t know in which manner the configuration of shoerwall firewall is done at the time of initial installation.
Also I tried to restart the iptables but unable to find out the way to restart in debian linux.
Tried,
/etc/init.d/ip….. ----no IP table at here
Service iptables restart/start/stop ---- no success
/sbin/iptables start/stop/restart -----no success
Last query,
If I configure the iptables rule if shoerwall firewall is there …. Can that rule take effect…..

Please sugesst…
 
Old 05-04-2011, 10:04 PM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005
One thing I noticed... you spelled Service, and not service, note the capital S. Linux is case sensitive; I just want to rule that out. Also check out this reference: http://www.cyberciti.biz/tips/how-to...-services.html

Also look here at this thread: http://www.linuxquestions.org/questi...tables-334836/

Cheers,

Josh
 
Old 05-06-2011, 10:06 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
i found the shoerwall firewall installed on system. now i wanted to open port no.7 for application comunication purpose please let me know if any one knows.
Take a look at the FAQ
http://www.shorewall.net/FAQ.htm

Kind regards
 
Old 05-09-2011, 05:25 AM   #6
gadhave.vikas
LQ Newbie
 
Registered: May 2009
Location: Navi Mumbai (Maharashtra)
Distribution: Dont Know
Posts: 22

Original Poster
Rep: Reputation: 0
Hi ,


( Sorry for delay )

there are lots of troubles coming in my way.

Here is what i did yet:

1) I have added following entry in the rules file of shorewall :

#ACTION SOURCE DESTINATION PROTO DEST PORT(S)
ACCEPT net $FW udp 7

and restarted shorewall (/etc/init.d/shorewall restart)

but unfortunately it did not work . I tried 8-10 times then i got confused . SO I have stopped a shorewall service (/etc/ini.d/shorewall stop ) and then tried to telnet server on port 7 but that also did not work.

so i checked with any other firewall found iptable service does not exist . ( ps -ef | grep iptables -> no output) but after doing iptalbes --list it gives set of rules assigned to this syste.

and I am trying to add rules to the iptables list but it is not accepting my rules .
iptables -A INPUT -d serverIP -p udp --dport 7 -j ACCEPT

Linux version is : Debian 2.6.26-2-amd64

Please let me know what should i do and where am i going wrong ?


Thanks
 
Old 05-09-2011, 06:07 AM   #7
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
What doesn't work?
error messages?
Do you have a service listening on port 7?

Kind regards
 
Old 05-09-2011, 08:42 AM   #8
Rakesh Kurutkar
LQ Newbie
 
Registered: Sep 2008
Posts: 1

Rep: Reputation: 0
currently there is no service running on the port 7.
i checked it with netstat -tulpn | grep 7 but didnot get any service runningon port 7.


I have tried to add rule using iptables with below command:
iptables -A INPUT -d serverIP -p udp --dport 7 -j ACCEPT
but when i did iptables --list it is now showing me currently added rule .

I tried iptables-save but after that also it is not showing me the newly added rule .


Not getting any error as such.


for checking port 7 is open or not , I am doing telnet from different server of the same network " #telnet <server ip> 7 " but it is not working , do you know any other way to check this ?
 
Old 05-09-2011, 10:55 AM   #9
gadhave.vikas
LQ Newbie
 
Registered: May 2009
Location: Navi Mumbai (Maharashtra)
Distribution: Dont Know
Posts: 22

Original Poster
Rep: Reputation: 0
hye team,

information

Rakesh is from my team.......so consider his comments also

Rgds,
Vikas
 
Old 05-09-2011, 11:27 AM   #10
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
'telnet' is a tcp protocol, not a udp protocol. So you can't check using telnet.

If there is nothing listening on port 7, how do you now that it does not work?
 
Old 05-10-2011, 05:26 AM   #11
gadhave.vikas
LQ Newbie
 
Registered: May 2009
Location: Navi Mumbai (Maharashtra)
Distribution: Dont Know
Posts: 22

Original Poster
Rep: Reputation: 0
Hey,

I agree with you but newly added rules should reflect in iptables --list output.

i have one doubt is there possibilities of problem because of both fire wall are active...(sheorwall and iptables) ?

what will be the other ways to check the port is listening or not ( we have tried netstat -tulpn | grep prot number) but no success.

please suggest .
 
Old 05-11-2011, 01:12 AM   #12
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,847

Rep: Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584
There are 2 things to check on whether a port is 'open' and/or being used

1. netstat will tell you if a service is listening on port 7

2. iptables -nvL will show you if you have a rule that relates to port 7 ie even if there is a service there, can you get to it from the outside...
 
1 members found this post helpful.
Old 05-11-2011, 01:47 AM   #13
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by gadhave.vikas View Post
I agree with you but newly added rules should reflect in iptables --list output.
Point taken; not sure if you checked it.

Quote:
Originally Posted by gadhave.vikas View Post
Hey,
I have one doubt is there possibilities of problem because of both fire wall are active...(sheorwall and iptables) ?
Shorewall is no firewall, but a front-end to iptables.
 
Old 05-11-2011, 10:39 AM   #14
gadhave.vikas
LQ Newbie
 
Registered: May 2009
Location: Navi Mumbai (Maharashtra)
Distribution: Dont Know
Posts: 22

Original Poster
Rep: Reputation: 0
need to open port number 7 on debian linux

Thanks Chrism01,

I check with provided command by you.
I able to see the rule with command "iptables -nvL" as below.
0 0 ACCEPT udp -- * * 0.0.0.0/0 (IP address) udp dpt:7

but when i tried to do the telnet System IP ADDRESS 7

i get nothing....

how can i check if it is working fine?

Rgds,
vikas
 
Old 05-11-2011, 10:44 AM   #15
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
You need to have something listening on that port. So write a little udp echo server and client (examples available on the net; maybe something from here.

And as said, telnet is a tcp protocol (not an udp protocol) so you can not use it.

Last edited by Wim Sturkenboom; 05-11-2011 at 10:51 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Identify and explain the major number, minor number, and revision number in Linux... turbomen Linux - Newbie 1 11-16-2010 02:48 AM
Amarok + Last.fm: Can't connect - How to set up port number? (Debian Lenny) fields Linux - Software 4 05-19-2009 04:10 PM
USB to serail port adaptor COM port number areftaidi Linux - Software 2 09-25-2007 01:05 AM
NFS Port Number on debian Sarge jess1975 Debian 1 11-04-2005 06:59 AM
How to open a port number in solaris UltraSoul Solaris / OpenSolaris 3 07-25-2005 04:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration