The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
Google UNIX.COM


IP Networking Questions involving TCP/IP, Routers, Hubs, Network protocols, etc go here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to know port is block.. Saurabh78 IP Networking 2 05-15-2008 07:51 AM
disabled telnet now need port 23 or port 22 panzerkw SUN Solaris 3 03-05-2007 11:08 AM
BAD SUPER BLOCK - Run fsck with alternate super block number admin wanabee HP-UX 1 09-08-2006 10:57 AM
unix program that can port scan a c block of ips for proxies user UNIX for Dummies Questions & Answers 1 07-11-2005 11:01 AM
block telnet to specific port xiamin IP Networking 5 03-20-2002 04:51 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-30-2008
Registered User
 

Join Date: Jun 2004
Posts: 15
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
How to block a port

Hi,
i faced a problem, where i have to block a port, therefore nobody used it, evenwith SO_REUSEADDR flag. How can i achive it.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-30-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,289
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Without knowing any more - consider using a firewall.

If a port is "busy" you cannot bump the user off the port unless you kill the process that has the socket to the port open. Then you open the port and block it.

It sounds like you want some kind of firewall rather than a simple C program.
Reply With Quote
  #3 (permalink)  
Old 04-30-2008
DukeNuke2's Avatar
Soulman (Moderator)
 

Join Date: Jul 2006
Location: Germany, Berlin
Posts: 1,125
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Quote:
Originally Posted by jim mcnamara View Post
It sounds like you want some kind of firewall rather than a simple C program.
i think so too, thread moved to ip networking...
Reply With Quote
  #4 (permalink)  
Old 05-01-2008
Registered User
 

Join Date: Jun 2004
Posts: 15
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Actually our our product facing similar type of problem. Therefore, i need it. Anybody will help me.
Reply With Quote
  #5 (permalink)  
Old 05-15-2008
Registered User
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 211
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Well, the simplest way to achieve something like this (for *nix) is to link your app with libwrap: libwrap - Wikipedia, the free encyclopedia and then bundle tcpwrappers + a sample hosts.allow and hosts.deny with your product.

I'm sure windows has similar api functionality for their packet filter.

Alternatively you can come up with an internal packet filter for the application based on a configuration file, parser and logic that you devise.
It's very simple in theory...An ip based ruleset is created via flat file, xml, etc.., then on a client connect the ruleset is parsed, the client address is
compared for exclusion. If exclusion is indicated the connection is closed with no further processing except, perhaps, for a log notice, otherwise the client
is serviced.

Last edited by ramen_noodle; 05-15-2008 at 08:06 AM.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes


The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
421 service not available, remote server has closed connection ^m automate ftp autosys awk trim bash eval bash for loop boot: cannot open kernel/sparcv9/unix command copy/move folder in unix curses.h cut command in unix daemon process export command in unix find grep find mtime find null character in a unix file glance unix grep multiple lines grep or grep recursive inaddr_any inappropriate ioctl for device lynx javascript mailx attachment mget mtime perl array length ping port remove first character from string in k shell replace space by comma , perl script scp recursive segmentation fault(coredump) sftp script snoop unix stale nfs file handle syn_sent tar exclude tar extract to folder test: argument expected unix unix .profile unix forum unix forums unix internals unix interview questions unix mtime unix simulator unix.com vi substitute while loop within while loop shell script


All times are GMT -7. The time now is 12:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101