{"id":50,"date":"2010-02-01T14:51:14","date_gmt":"2010-02-01T13:51:14","guid":{"rendered":"http:\/\/toderu.ro\/blog\/?p=50"},"modified":"2010-02-01T14:51:14","modified_gmt":"2010-02-01T13:51:14","slug":"port-forwarding-linux","status":"publish","type":"post","link":"https:\/\/kb.toderu.ro\/?p=50","title":{"rendered":"Port Forwarding linux"},"content":{"rendered":"<p>\t\t\t\t10 Port Forwarding<\/p>\n<p>By:<br \/>\n    Stephen Carville<br \/>\nRev:<br \/>\n    08\/23\/02 <\/p>\n<p>Port Forwarding is also possible using OpenSSH (Sec 17.2).<\/p>\n<p>10.1 Using xinetd redirect function<\/p>\n<p>The simpliest and, in my opinion, the preferred way to handle redirecting unencrypted connections is to use the redirect<br \/>\ncapability built into xinetd.<\/p>\n<p>If necessary, add services names to \/etc\/services. For example:<br \/>\n<code>geofwd  50005\/tcp           # GeoTrac forwarded port<\/code><\/p>\n<p>   1. Add service file to \/etc\/xinetd.d. Example file:<br \/>\n      <code># default: on<br \/>\n      # description: forward connections to indian:1005<br \/>\n      service geofwd<br \/>\n      {<br \/>\n         flags = REUSE<br \/>\n         socket_type = stream<br \/>\n         wait = no<br \/>\n         user = root<br \/>\n         redirect = 192.168.124.4 1005<br \/>\n         log_on_failure += USERID<br \/>\n      }<\/code><br \/>\n   2. Restart xinetd<br \/>\n     <code> # \/etc\/rc.d\/init.d\/xinetd restart<\/code><\/p>\n<p>10.2 Using Netcat<\/p>\n<p>The netcat utility is sometimes described as the &#8216;Swiss Army Knife&#8221; of the network. Here we are using it for very basic<br \/>\nport forwarding from an externally accessible server to an internal server. If it is not necessary to run the forwarding<br \/>\nservice continiously, on Redhat it is prefereable to use xinetd forwarding.<\/p>\n<p>   1. Install netcat from CDROM or from ftp<br \/>\n      <code># rpm -Uvh ftp:\/\/volga\/pub\/RPMS\/nc-*.rpm<\/code><br \/>\n   2. Add services names to \/etc\/services. For example:<br \/>\n      <code>geofwd  50005\/tcp           # GeoTrac forwarded port(netcat)<\/code><br \/>\n   3. Add service file to \/etc\/xinetd.d. Example file:<br \/>\n   4. <code># default: on<br \/>\n      # description: forward connections to panama:1005<br \/>\n      service geofwd<br \/>\n      {<br \/>\n         flags = REUSE<br \/>\n         socket_type = stream<br \/>\n         wait = no<br \/>\n         user = root<br \/>\n         server = \/usr\/bin\/nc<br \/>\n         server_args = 192.168.124.38 1005<br \/>\n         log_on_failure += USERID<br \/>\n      }<\/code><br \/>\n   5. Restart xinetd<br \/>\n      <code># \/etc\/rc.d\/init.d\/xinetd restart<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>10 Port Forwarding By: Stephen Carville Rev: 08\/23\/02 Port Forwarding is also possible using OpenSSH (Sec 17.2). 10.1 Using xinetd redirect function The simpliest and, in my opinion, the preferred way to handle redirecting unencrypted connections is to use the redirect capability built into xinetd. If necessary, add services names to \/etc\/services. For example: geofwd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-50","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=50"}],"version-history":[{"count":0,"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=\/wp\/v2\/posts\/50\/revisions"}],"wp:attachment":[{"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}