Sponsored Content
Full Discussion: How to block a port
Special Forums IP Networking How to block a port Post 302190814 by Saurabh78 on Wednesday 30th of April 2008 03:28:58 PM
Old 04-30-2008
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.
 

10 More Discussions You Might Find Interesting

1. IP Networking

block telnet to specific port

Hello All I am running redhat linux 7.2 and would like to know how i can block telnetting to a specified port . say for example i would like to block telnet acesses to port 80. regards Xiamin (5 Replies)
Discussion started by: xiamin
5 Replies

2. UNIX for Dummies Questions & Answers

unix program that can port scan a c block of ips for proxies

can anyone tell me a unix program that can port scan a c block of ips for proxies? a fast one, with reliable results, that can load an ip list, or set an ip range, and specify ports thanks! (1 Reply)
Discussion started by: user
1 Replies

3. IP Networking

How to know port is block..

My server is running on a port 16386, in the case when this port is blocked by some other application ( anti virus etc. ) or firewall then how do i know it's block? Is bind will return any specific error in this case. I have to know is it blocked or not? (2 Replies)
Discussion started by: Saurabh78
2 Replies

4. Linux

using firewall to block port

Hi, I will like to allow access to the mysql port (3306) to certain IP address. All other IP's should be automatically blocked. What is the best way to do this? (8 Replies)
Discussion started by: shantanuo
8 Replies

5. Shell Programming and Scripting

to block the files uploading via the port

Hi Folks, I am not good in shell scripting. Please help me with my problem. Is it possible to block the file named "ss.cgi" using the port 25 to upload. (4 Replies)
Discussion started by: gsiva
4 Replies

6. Shell Programming and Scripting

Block local and remote port with iptables - Script BASH

Hello I'm beginner in the linux scripting and i would like to get help. I want to create a script that can block one or more Port even see all the TCP port. The ports must be blocked even when starting my machine. Of course requires a second script which will allow the ports that you want to... (0 Replies)
Discussion started by: houstaf
0 Replies

7. UNIX for Dummies Questions & Answers

iptables to block port 25 only to a certain range

I want to limit all *outbound* traffic on eth0 (or all *.*) on port 25 to a specific (allowed) range... I.E. 192.168.1.5 (local ip) tries to connect to 1.2.3.4:25 (outside real world ip) It can proceed because 1.2.3.0/24 is the allowed range Now, 192.168.1.5 (local ip) tries to connect to... (1 Reply)
Discussion started by: holyearth
1 Replies

8. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

9. Web Development

Two public ip for server, how to block a port for ip2 but not for ip1

Hello, I am not sure that it's possible to set a server for explained below scenario: I have ordered a second ip for my streaming server. Both ip addresses are set and well responding to my ping requests. LAMP is installed into server. Assume that port 15678 is running for nginx. Admin port is... (0 Replies)
Discussion started by: baris35
0 Replies

10. Solaris

Block port for all except for one specific ip in Solaris11.4

Hi, I need to block ssh port 22 from all the servers except one server ip. Until solaris11.3 and below, I used to do like below(under /etc/ipf/ipf.conf),and it's working fine pass in quick from $server_ip to any port=22 block in quick from any to any port=22 But I tried almost same in... (1 Reply)
Discussion started by: Sumanthsv
1 Replies
SOCKET_SET_OPTION(3)							 1						      SOCKET_SET_OPTION(3)

socket_set_option - Sets socket options for the socket

SYNOPSIS
bool socket_set_option (resource $socket, int $level, int $optname, mixed $optval) DESCRIPTION
The socket_set_option(3) function sets the option specified by the $optname parameter, at the specified protocol $level, to the value pointed to by the $optval parameter for the $socket. PARAMETERS
o $socket - A valid socket resource created with socket_create(3) or socket_accept(3). o $level - The $level parameter specifies the protocol level at which the option resides. For example, to retrieve options at the socket level, a $level parameter of SOL_SOCKET would be used. Other levels, such as TCP, can be used by specifying the protocol number of that level. Protocol numbers can be found by using the getprotobyname(3) function. o $optname - The available socket options are the same as those for the socket_get_option(3) function. o $optval - The option value. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 socket_set_option(3) example <?php $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if (!is_resource($socket)) { echo 'Unable to create socket: '. socket_strerror(socket_last_error()) . PHP_EOL; } if (!socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1)) { echo 'Unable to set option on socket: '. socket_strerror(socket_last_error()) . PHP_EOL; } if (!socket_bind($socket, '127.0.0.1', 1223)) { echo 'Unable to bind socket: '. socket_strerror(socket_last_error()) . PHP_EOL; } $rval = socket_get_option($socket, SOL_SOCKET, SO_REUSEADDR); if ($rval === false) { echo 'Unable to get socket option: '. socket_strerror(socket_last_error()) . PHP_EOL; } else if ($rval !== 0) { echo 'SO_REUSEADDR is set on socket !' . PHP_EOL; } ?> PHP Documentation Group SOCKET_SET_OPTION(3)
All times are GMT -4. The time now is 04:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy