LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-01-2008, 02:05 PM   #1
thiagarn
Member
 
Registered: Jan 2008
Posts: 47

Rep: Reputation: 15
How to open a UDP port


HI,

I would like to know how to open a UDP port in Linux. Basically i installed Sebek. I want it to be hooked up to port 1101.

Any response appreciated.

Thanks
 
Old 03-01-2008, 02:16 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you open a port by using it. there's no such thing as being just "opened" outright. you can explicitly deny access with a firewall if you have one, but if not there's nothing in the way of doing what you want.
 
Old 03-01-2008, 02:48 PM   #3
thiagarn
Member
 
Registered: Jan 2008
Posts: 47

Original Poster
Rep: Reputation: 15
ok...In that cse, i installed Sebek and configured the source port to be UDP port 1101.

But i could not really see any sebek data.

So i checked it by runnning nmap and scanned for UDP open ports. I did not find UDP port 1101 in the resuls given by nmap.And this could be the reason why sebek is not logging anything.

I dont know why this nmpa doesnt show 1101 as open port.

Any idea?

Thanks
 
Old 03-01-2008, 02:56 PM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
On the machine running your software, try
Code:
netstat -lu
to list all listening udp sockets. If yours is listed there, then there is something else preventing others from sending to it. Take a look at your iptables rules (if you have any configured). If those look sane, are you behind any external firewall device? If so, make sure that it is not dropping those packets.
 
Old 03-01-2008, 03:43 PM   #5
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
maybe posting your distro and version someone may be familiar with it to tell you where to edit to open a port in your iptables firewall config file. that is if there is a firewall running on the machine. As root one maybe able to tell from this command as root.
/sbin/iptables -L

Brian
 
Old 03-01-2008, 03:54 PM   #6
thiagarn
Member
 
Registered: Jan 2008
Posts: 47

Original Poster
Rep: Reputation: 15
ok...i tried doing netstat -lu.

It doesnt have 1101 opened. I'm sure i have installed sebek.
Dont know why this port is closed


Any suggestions?
 
Old 03-01-2008, 04:18 PM   #7
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Perhaps the netstat output is correct, but it’s listed as the service name instead of a numerical port. In this case, it might say pt2-discover. I should have mentioned this earlier, but if you want to force numerical port numbers, give the -n flag. If you want to see processes owning the sockets, use the -p flag (may require root privileges). If you want to see both listening and sending sockets, use the -a flag. Altogether, that’s:
Code:
sudo netstat -aunp
Also, are you sure that sebek is running (in addition to being installed)? What is the output of:
Code:
sudo lsof -c sebek
(assuming the executable is running as sebek).
 
Old 03-01-2008, 04:28 PM   #8
thiagarn
Member
 
Registered: Jan 2008
Posts: 47

Original Poster
Rep: Reputation: 15
Doing a sudo lsof -c sebek did not give any output. Does that mean sebek is not installed?

I'm using Red hat Enterprise 5 and kernels 2.6.18.

Kindly advice -
 
Old 03-01-2008, 04:32 PM   #9
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Now knowing the distro in question and if you used default RHEL 5 install options then the firewall iptables daemon script is enabled. You need to edit /etc/sysconfig/iptables and place this line somewhere in the middle.
Code:
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 1101 -j ACCEPT
Then restart iptables daemon as root use this command.
/sbin/service iptables restart

Now check for open port

Brian
 
Old 03-01-2008, 04:37 PM   #10
thiagarn
Member
 
Registered: Jan 2008
Posts: 47

Original Poster
Rep: Reputation: 15
Sorry forgot to mention this earlier ...i used deafult rhel5 and then later disabled the firewall.
 
Old 03-01-2008, 04:45 PM   #11
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
That's okay, because the firewall only controls access to a port, it has no part to play when it comes to "opening" it. As already mentioned by acid_kewpie, you need to have something use the port in order for it to be open. At this point, I suggest you use the netstat advice you've received in order to make sure your service is listening properly.
 
Old 03-01-2008, 04:57 PM   #12
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
If you have disabled the iptables firewall then I don't think that is your problem.
Is selinux enabled? If so I would disable to see if that works if no firewall is running.

Brian
 
Old 03-01-2008, 05:13 PM   #13
thiagarn
Member
 
Registered: Jan 2008
Posts: 47

Original Poster
Rep: Reputation: 15
selinux is disabled. No luck
 
Old 03-01-2008, 05:16 PM   #14
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
What does the output of ' /sbin/iptables -L ' say?

Brian
 
Old 03-01-2008, 05:24 PM   #15
thiagarn
Member
 
Registered: Jan 2008
Posts: 47

Original Poster
Rep: Reputation: 15
Output of sbin/iptables -L

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
799 udp port open ddaas Linux - Security 4 07-13-2005 05:33 PM
Wandering, high, open UDP port detected by nmap conn-fused Linux - Security 1 05-15-2005 06:23 AM
TCP Port 53 Open - How to enable UDP 53? stardotstar Linux - Networking 6 03-16-2005 04:49 AM
UDP Port 1697 RandomIZE Linux - Networking 5 03-23-2004 03:47 PM
How do I open up a UDP port? Dirt Linux - Networking 9 06-06-2003 05:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:34 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