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