How to configure Iptable to enable port forwarding Announcing the arrival of Valued Associate...

What do you call the holes in a flute?

How should I respond to a player wanting to catch a sword between their hands?

Unable to start mainnet node docker container

When communicating altitude with a '9' in it, should it be pronounced "nine hundred" or "niner hundred"?

What to do with post with dry rot?

What LEGO pieces have "real-world" functionality?

What can I do if my MacBook isn’t charging but already ran out?

What is the largest species of polychaete?

How to rotate it perfectly?

How are presidential pardons supposed to be used?

Complexity of many constant time steps with occasional logarithmic steps

What is the order of Mitzvot in Rambam's Sefer Hamitzvot?

Can a monk deflect thrown melee weapons?

When is phishing education going too far?

If A makes B more likely then B makes A more likely"

Is drag coefficient lowest at zero angle of attack?

Simulating Exploding Dice

Why is there no army of Iron-Mans in the MCU?

Stopping real property loss from eroding embankment

Cauchy Sequence Characterized only By Directly Neighbouring Sequence Members

Unexpected result with right shift after bitwise negation

Determine whether f is a function, an injection, a surjection

If I can make up priors, why can't I make up posteriors?

Mortgage adviser recommends a longer term than necessary combined with overpayments



How to configure Iptable to enable port forwarding



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questioniptables port forwardinglinux namespace, How to connect internet in network namespace?Linux iptables ssh port forwarding (martian rejection)Linux access point (airmon-ng/airmon-ng) not workingFreeBSD load balancer implementationAdding iptables rules after implementing fail2banIptables not working as I expect: response package not DNATed as expected with DNAT in PREROUTINGHow to route traffic from a specific user through a VPN on LinuxLocal port forwarding using iptables is not workingIPTables and Port Forwarding on an OpenVPNAS Server





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















The basic requirement: The iptable server can connect to mail server 10.1.2.3 on pop3s port 995, but a lot of internal/DMZ servers in 10.1.1.0/24 cannot connect to mail server on the port. I want to configure iptable server to play the NAT proxy to relay the traffic from 10.1.1.0/24 to 1.1.2.3:995.



When I configured the iptables on centos 6.9 with the below rules:
iptables -t nat -A PREROUTING -s 10.1.1.0/24 -i eth0 -p tcp -m tcp --dport 995 -j DNAT --to-destination 10.1.2.3:995
iptables -t nat -A POSTROUTING -s 10.1.1.0/24 -p tcp -m tcp --dport 995 -j MASQUERADE



I really succeeded in the network forwarding.



But when we upgrade the iptable server and internal/DMZ server to centos7.4, it cannot work well under the rule configuration.



The internal server's connecting to mail server will give the error message out like "bad file descriptor(connect:errno=9)".



The ipv4 forwarding is enabled in kernel, selinux is set to permissive.









share







New contributor




Yanedanny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    The basic requirement: The iptable server can connect to mail server 10.1.2.3 on pop3s port 995, but a lot of internal/DMZ servers in 10.1.1.0/24 cannot connect to mail server on the port. I want to configure iptable server to play the NAT proxy to relay the traffic from 10.1.1.0/24 to 1.1.2.3:995.



    When I configured the iptables on centos 6.9 with the below rules:
    iptables -t nat -A PREROUTING -s 10.1.1.0/24 -i eth0 -p tcp -m tcp --dport 995 -j DNAT --to-destination 10.1.2.3:995
    iptables -t nat -A POSTROUTING -s 10.1.1.0/24 -p tcp -m tcp --dport 995 -j MASQUERADE



    I really succeeded in the network forwarding.



    But when we upgrade the iptable server and internal/DMZ server to centos7.4, it cannot work well under the rule configuration.



    The internal server's connecting to mail server will give the error message out like "bad file descriptor(connect:errno=9)".



    The ipv4 forwarding is enabled in kernel, selinux is set to permissive.









    share







    New contributor




    Yanedanny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      The basic requirement: The iptable server can connect to mail server 10.1.2.3 on pop3s port 995, but a lot of internal/DMZ servers in 10.1.1.0/24 cannot connect to mail server on the port. I want to configure iptable server to play the NAT proxy to relay the traffic from 10.1.1.0/24 to 1.1.2.3:995.



      When I configured the iptables on centos 6.9 with the below rules:
      iptables -t nat -A PREROUTING -s 10.1.1.0/24 -i eth0 -p tcp -m tcp --dport 995 -j DNAT --to-destination 10.1.2.3:995
      iptables -t nat -A POSTROUTING -s 10.1.1.0/24 -p tcp -m tcp --dport 995 -j MASQUERADE



      I really succeeded in the network forwarding.



      But when we upgrade the iptable server and internal/DMZ server to centos7.4, it cannot work well under the rule configuration.



      The internal server's connecting to mail server will give the error message out like "bad file descriptor(connect:errno=9)".



      The ipv4 forwarding is enabled in kernel, selinux is set to permissive.









      share







      New contributor




      Yanedanny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      The basic requirement: The iptable server can connect to mail server 10.1.2.3 on pop3s port 995, but a lot of internal/DMZ servers in 10.1.1.0/24 cannot connect to mail server on the port. I want to configure iptable server to play the NAT proxy to relay the traffic from 10.1.1.0/24 to 1.1.2.3:995.



      When I configured the iptables on centos 6.9 with the below rules:
      iptables -t nat -A PREROUTING -s 10.1.1.0/24 -i eth0 -p tcp -m tcp --dport 995 -j DNAT --to-destination 10.1.2.3:995
      iptables -t nat -A POSTROUTING -s 10.1.1.0/24 -p tcp -m tcp --dport 995 -j MASQUERADE



      I really succeeded in the network forwarding.



      But when we upgrade the iptable server and internal/DMZ server to centos7.4, it cannot work well under the rule configuration.



      The internal server's connecting to mail server will give the error message out like "bad file descriptor(connect:errno=9)".



      The ipv4 forwarding is enabled in kernel, selinux is set to permissive.







      linux iptables-redirect





      share







      New contributor




      Yanedanny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      Yanedanny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      Yanedanny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 3 mins ago









      YanedannyYanedanny

      1




      1




      New contributor




      Yanedanny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Yanedanny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Yanedanny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Yanedanny is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512485%2fhow-to-configure-iptable-to-enable-port-forwarding%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Yanedanny is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Yanedanny is a new contributor. Be nice, and check out our Code of Conduct.













          Yanedanny is a new contributor. Be nice, and check out our Code of Conduct.












          Yanedanny is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512485%2fhow-to-configure-iptable-to-enable-port-forwarding%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...