xinetd port forwarding

I always forget how to do this. This little sample will help me next time:

service my-web
{
type = UNLISTED
socket_type = stream
protocol = tcp
wait = no
user = root
bind = 0.0.0.0
port = 80
only_from = 0.0.0.0
redirect = 172.16.1.219 80
}

notes:

  • This file goes in /etc/xinetd.d/my-web
  • For this to work, the service must exist in services or the type must be UNLISTED
  • The bind address is 0.0.0.0 to listen to all addresses on the server. If you want to limit it to listen on a specific IP, like localhost, enter an IP address instead.
  • Port is the port it is going to listen on.
  • Redirect is the destination ip and port.
This entry was posted in Linux. Bookmark the permalink.

Comments are closed.