Iptables port forwarding settings

Source: Internet
Author: User
The information comes from the internet. Please forget it. application scenario: assume that there are three devices A, B, and C, AB can access each other, BC can access each other, A and C cannot access each other directly, and Oracle database is installed on C, how can A access C databases? Specific environment: A (192.168.8.253), windowvistaB (192.168.8.150), and linuxC application scenarios:
Assume that there are three devices A, B, and C. A <=> B can access each other, B <=> C can access each other, and A and C cannot access each other directly, oracle Database is installed on C. How can A access C databases?
Specific environment:
A (192.168.8.253), window vista
B (192.168.8.150), linux CentOS 5.5
C (192.168.8.49), linux Redhat AS4, Oracle (SID: ora9i, Port: 1521)
Procedure:
1. B (192.168.8.150) allows IP packet forwarding. modify net. ipv4.ip _ forward = 1 in the configuration file/etc/sysctl. conf (1: allows forwarding. the default value is 0)
PS: There may be differences between linux versions. this article passes the test under CentOS5.5
2. modify B (192.168.8.150) IptablesRules in:
Shell script:
$ Iptables-t nat-a prerouting-p tcp-m tcp -- dport 11521-jDNAT -- to-destination 192.168.8.49: 1521
$ Iptables-t nat-a postrouting-p tcp-m tcp -- dport 1521-jSNAT -- to-source 192.168.8.150
$ Service iptables save
$ Service iptables restart
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.