Allow Internet access to the internal WWW server through NAT

Source: Internet
Author: User
Article title: allow external networks to access internal WWW Servers through NAT. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

China Telecom has a valid IP address. on a computer with dual NICs, eth0 is connected to the internal LAN, and the IP address is
192.168.123.1, and eth1 is connected to the internet (internet). the IP address is 202.96.X. X.
Now I want to enable the internal WWW Server (IP 192.168.123.8) to enable
User access, OK? How can this problem be solved?
Iptables-t nat-a prerouting-p tcp-d 202.96.X.X -- dport 80-j DNAT -- to-destination 192.168.123.8
If NAT is used, it is best to use a two-port firewall (PIX506E), which is fast and secure!
Thank you! I will start work in the evening :)
If it succeeds, you can directly use the IP address 202.96.X.X to access it?
What if I want to use a domain name for access? (The DNS has been configured and a valid domain name has been applied.
Should the domain name be directed to the computer 202.96.X.X? Thank you! It is too expensive to use hardware, which is not cost-effective.
Iptables-t nat-a prerouting-p tcp-d 202.96.X.X -- dport 80-j DNAT -- to-destination 192.168.123.8
Enter 202.96.X in the browser. Why can't I open X? Are you sure you want to set it?
Paste your firewall file.
That's the answer, brother?
One more sentence, just one sentence ~!
# Iptables-t nat-a postrouting-o eth1-j MASQUERADE
Can you go out on the intranet?
Iptables-t nat-a postrouting-o eth1-j MASQUERADE is A dialing rule
Try
Iptables-t nat-a prerouting-p tcp-I eth1-d 202.96.X.X -- dport 80-j DNAT -- to-destination 192.168.123.8
It's done, as the old man said above. But it is not allowed on the intranet. it can be enabled on the Internet.
If an invalid IP address does not work/
My IP address belongs to work.
10.125.X.X

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.