Linux firewall configuration-SNAT1, linux Firewall snat1
1. Lab Objectives
Based on the experiment "firewall configuration-access the Internet WEB", install Wireshark on the WEB server, set the Wireshark filter condition to capture HTTP packets, and enable the capture in Wireshark, access the WEB server on the Intranet testing machine, view the capture results, and then set SNAT on the gateway firewall to view the capture results
(Firewall configuration-access the Internet WEB: http://www.cnblogs.com/liaoyuanyang/p/6750257.html)
2. SNAT (source network address translation)
The function of source address conversion is to convert the source address of an ip packet to another address, which is commonly known as ip Address Spoofing or disguise.
When the internal address needs to access services on the public network (such as web access), the internal address will initiate a connection, and the gateway on the router or firewall will convert the internal address, the private IP address of the internal address is converted to the public IP address of the public network. The address translation of the gateway is called SNAT. It is mainly used for internal shared IP Access to the outside, and can protect the Intranet security.
3. Experiment Topology
4. Experiment steps
(1) complete the "firewall configuration-access Internet WEB" Experiment
(2) install Wireshark on the WEB Server
1) Configure local Yum source (http://www.cnblogs.com/liaoyuanyang/p/6746542.html)
2) install Wireshark
[Root @ lyy yum. repos. d] # yum install wireshark-gnome-y // gnome indicates the desktop version
3) Enable Wireshark
After the installation is complete, click "application"> "Internet"> "Wireshark" to open it.
(3) set Wireshark filtering conditions to capture HTTP packets
Click "Capture"> "Option". In the displayed window, select "eht0"
Double-click "eth0" -- click "Capture Filter" in the pop-up window -- click "http tcp port (80)" -- OK
(4) access the WEB server on the Intranet Test Machine
The source address is 192.168.0.10 of the Intranet test server.
(5) set SNAT on the gateway firewall
[Root @ lyy desktop] # iptables-t nat-a postrouting-s 192.168.0.0/24-o eth1-j MASQUERADE
MASQUERADE: uses dynamic address disguise to replace the source IP address with the IP address on the NIC that sends data.
(6) access the WEB server on the Intranet test machine. The capture results are as follows:
At this time, the source address has been replaced with the gateway's eth1 IP address, and the SNAT goal has been achieved!