⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcpproxy.1

📁 tcp protocol proxy,it is userful!
💻 1
字号:
.de ES.sp.in +0.5i...de EE.in -0.5i.sp...de EX.sp.in +0.5i\\$1.in -0.5i.sp...TH TCPPROXY 1 "02 September 1999".SH NAMEtcpproxy \- generic TCP proxy server.SH SYNOPSIS\fBtcpproxy\fR [\fIoptions\fR] [\fIserver\fR].SH DESCRIPTION.I tcpproxyis a generic TCP proxy server.It connects a client and a server and forwards any data from the client tothe server and vice versa.\fItcpproxy\fR doesn't care about the data being transported..PPIf \fIserver\fR begins with a `/' or `.' it's taken as a pathname to aprogram that acts as a request handler for incoming connections.Otherwise \fIserver\fR is interpreted as \fIhost\fR[:\fIport\fR] and theclient request is forwarded to the given \fIhost\fR and \fIport\fR.If in this case \fIport\fR is omitted \fItcpproxy\fR uses it's own serverport as destination port on \fIhost\fR..PPIf \fItcpproxy\fR has to start a local program it set the environmentvariables \fBPROXY_PORT\fR, \fBPROXY_INTERFACE\fR, \fBPROXY_CLIENT\fR and\fBPROXY_CLIENTNAME\fR with the data of the current connection.The `PROXY_' prefix might be changed with the command line option \fB-v\fRor the \fBsetenv\fR configuration directive..PP.I tcpproxycan be either started from.IR inetd (1)or act as a standalone server listening an several ports.If the \fIserver\fR argument is missing \fItcpproxy\fR reads it's configurationfile \fI/etc/tcpproxy.conf\fR and either forwards the current connection orbinds to the specified ports waiting for client requests..SH "CONFIGURATION FILE"The following directives define the global configuration..TP\fBuid\fR \fInumeric-uid\fRdefines the numeric user id to which \fItcpproxy\fR changes before listeningto client requests..TP\fBgid\fR \fInumeric-gid\fRsame as \fBuid\fR but for the group id under which the server runs..TP\fBstandalone\fR [\fByes\fR|\fBno\fR]if set to `yes' the server binds to the defined ports waiting for requests.This is the default if a configuration file is used..PPThe \fBuid\fR and \fBgid\fR settings are only used if the user starting\fItcpproxy\fR is \fBroot\fR, otherwise they are ignored.If however the calling user is \fBroot\fR and no settngs are found\fItcpproxy\fR uses it's internal default of -1 and -2 for the user andgroup id.\fItcpproxy\fR won't run as root..PPThe following directives control the available services and how they areserved..TP\fBport\fR \fIport-number\fRdefines a new port where \fItcpproxy\fR should accept client requests..TP\fBinterface\fB \fIip-number\fRdefines an interface on which connections on the service port from thelast \fBport\fR directive are handled..TP\fBserver\fB \fIserver\fR[:\fIport\fR]defines the server and port where \fItcpproxy\fR will forward an incomingconnection to.If \fIport\fR is ommited the listening \fItcpproxy\fR port is used..TP\fBexec\fR \fIcommand\fRdefines a local command which is executed to handle a request..TP\fBacp\fR \fIprogram\fRsets the access control program that is used to grant or deny incomingconnections..TP\fBtimeout\fR \fItimeout\fRdefines a different timeout in seconds than the default of 60..TP\fBsetenv\fR \fIvarprefix\fRdefines the variable prefix..TP\fBwritefile\fR \fIfilename\fRdefines the basename for files where the server/client communicationis written..PPFor a service configuration either \fBserver\fR or \fBexec\fR must bespecified.The \fItimeout\fR value is only used in conjunction with a \fIserver\fRconfiguration and \fIvarprefix\fR only if requests are handled by a localprogram.\fBtimout\fR, \fBsenenv\fR amd \fBacp\fR define configuration defaults if theyappear before the first \fBport\fR directive..SH "ACCESS CONTROL"If for a port configuration an access control program is set this programis executed before forwarding the request.The acp can then decide if it grants (exit status 0) or denies (exitstatus not 0) the access.The acp can additionaly print a diagnostic message to the requesting clientthrough it's standard output and to the \fItcpproxy\fR through it'sstandard error..PPThe \fBPROXY_\fR variables are set for the current connection when theacp is called..SH OPTIONSThe following options are available:.TP\fB-a\fR \fIprogram\fRsets \fIprogram\fR as access control program..TP\fB-b\fR [\fIinterface\fR:]\fIport\fRtells \fItcpproxy\fR that it should bind to \fIport\fR on the given\fIinterface\fR.If \fIinterface\fR is omitted \fItcpproxy\fR will bind to all availableinterfaces.\fB-b\fR implies \fB-s\fR..TP\fB-f\fR \fIconfig\fRsets a different configuration file than \fI/etc/tcpproxy.conf\fR..TP\fB-l\fR \fIlogname\fRsets the name under which \fItcpproxy\fR writes to syslog..TP\fB-p\fRcreates the pidfile \fI/var/run/tcpproxy.pid\fR.This default name can be changed by giving the \fB-p\fR option twice followedby the name of the pidfile..TP\fB-s\fRsets standalone (bind to ports and listen) mode..TP\fB-t\fR \fItimeout\fRdefines a different \fItimeout\fR in seconds than the default of 60 secondsfor each connection..TP\fB-v\fR \fIvarprefix\fRspecifies a different variable prefix than `PROXY_' for the request handlervariables..TP\fB-w\fR \fIwritefile\fRspecifies that the client/server communication is written to thefile \fIwritefile\fR.pid.log..TP\fB-y\fRclears the whole environment before starting the request handler..TP.B -zlists the configured server ports and exits.This is useful if you want to shutdown the tcpproxy services with either\fIfuser\fR(1) or \fInetuser\fR(1).Giving \fB-z\fR twice lists the basic configuration data..PPIn case that the \fB-b\fR option is found on the command line the \fIserver\fRis expected..SH "EXAMPLES"The following examples assume that \fItcpproxy\fR is installed on a machinewith two network interface cards.One is the external interface with the IP number 192.44.100.7 and the otheris the internal one with IP numbers 192.168.1.1 and 192.168.1.2 (virtualinterfaces)..ES # # /etc/tcpproxy.conf - sample configuration #  # # Define SMTP proxys ... # port 25   # ... for outgoing ...   #   interface 192.168.1.1     server mailrelay.provider.com   # ... and incoming email.   #   interface 192.44.100.7     server mail.domain.com # # There are also NNTP-Servers on the outside # port 119    interface 192.168.1.1      server nntp.provider.com         interface 192.168.2.1      server nntp.other-provider.com # # Users from the outside can access our internal # POP3 server ... # port 110   interface 192.44.100.7   # ... but only trough a real application gateway.   #   exec /usr/local/sbin/pop3.proxy mail.domain.com.EEWith this configuration file \fItcpproxy\fR might be started with.EX "tcpproxy -s"to make tcpproxy bind itself to all the listed interfaces.Another way of serving requests is to configure the ports in\fI/etc/inetd.conf\fRand start \fItcpproxy\fR without the \fB-s\fR option from there.The proxy will then inspect it's configuration file to see how the connectionmade by \fIinetd\fR should be handled..PPtcpproxy -b 192.44.100.7:79 /bin/dateopens a date server on the external interface.This service won't be available on the interfaces numbered 192.168.1.1and .2 but the service is still accessable from the internal network:.ES user@192.168.1.10/~ > telnet 192.44.100.7 79 <current date goes here>.EEIf you want to provide a service only on one network card you'll have toimplement further access control of packet filters..SH NOTES\fItcpproxy\fR doesn't forward the FTP protocol.It doesn't work with any UDP protocol too.And furthermore \fItcpproxy\fR doesn't protect you against network attackslike buffer overflows.You'll have to use application gateway level proxys for that..SH "SEE ALSO".IR inetd (1).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -