0

As syslog uses the predefined socket port number of 514, is there any way to rebind this socket port number to any other port number specifically between 49152 and 65535. I am using Unix C 'gcc' compiler.

bash-3.2$ netstat -anp | grep udp (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) udp 0 0 0.0.0.0:2049 0.0.0.0:* -
udp 0 0 0.0.0.0:514 <-- needs to be changed 0.0.0.0:* -
udp 0 0 127.1.1.1:6688 0.0.0.0:* -
udp 0 0 0.0.0.0:4785 0.0.0.0:* -
udp 0 0 0.0.0.0:69 0.0.0.0:* -
udp 0 0 0.0.0.0:47451 0.0.0.0:* -
udp 0 0 0.0.0.0:613 0.0.0.0:* -
udp 0 0 0.0.0.0:111 0.0.0.0:* -
udp 0 0 0.0.0.0:1009 0.0.0.0:* -
udp 0 0 0.0.0.0:1012 0.0.0.0:* -

I need to change the 514 to the specified value.

4

1 回答 1

0

gcc 只是一个编译器,因此我们无法在编译期间更改 syslog 应用程序的端口号。话虽如此,很可能可以配置端口,通常在配置文件中,您应该可以将其设置为 514。这是一个讨论配置客户端和服务器端的示例:http: //itvomit.com/2012/06/01/linux-sending-log-files-to-a-remote-server/。根据您的系统,我将探讨如何更改端口号。

我们应该记住,如果我们将端口从 514 更改为 X,那么如果远程客户端将信息发送到 syslog,他们还需要将其发送到新的端口 X 而不是 514。这里有一个链接解释了如何我们需要更改客户端配置以将日志消息重定向到不同于 514 的端口号:http: //docs.splunk.com/Documentation/Storm/Storm/User/Howtosetupsyslog

于 2013-10-16T21:51:46.650 回答