Seven weeks four sessions (March 22)
10.15 iptables Filter Table case
10.16/10.17/10.18 iptables NAT Table Application
Extended
- Iptables application in a network segment http://www.aminglinux.com/bbs/thread-177-1-1.html
- Sant,dnat,masquerade http://www.aminglinux.com/bbs/thread-7255-1-1.html
- iptables limit syn Rate http://www.aminglinux.com/bbs/thread-985-1-1.html http://jamyy.us.to/blog/2006/03/206.html
Small case requirements, 80, 22, 21 port release, 22 port designated I beat IP segment release.
Defines a variable. Not so tedious.
133.0 network segments are released so there is no problem with this server.
ICMP example
Ping other machine-to-pass.
Ping this machine does not pass.
Remove the Rules
The script has disabled ICMP and needs to restore the default state.
It's ping.
Plus the rules.
Not through
Can ping outside the network, others ping does not pass you.
10.16iptables NAT
Prepare two machines. If you are worried about doing a bad experiment at once, you can take a snapshot.
Add 1 nic to aminglinux1.
Network card connected to the intranet switch, that is, the real machine, is not connected, this machine and another machine connected to the same intranet switch, they can communicate.
Add a section to customize the name.
The second machine, also to add a network card.
Disable the link.
Add a NIC
Custom Sections
Start the machine with two machines. The 1th machine has two network cards, the second machine, no window machine can link IP. There is no way to connect remotely.
Set up the network card IP, and set the virtual network card IP, copying a copy of the configuration file, modify the data, without setting up the gateway, DNS. Another method, the manual command line, sets the IP. The restart will fail, and if you want to make it permanent, change the configuration file. Copy the ENS33 configuration file and change the data.
Another machine, the ENS33 network card has been broken off.
For insurance, run the following command.
Ping does not pass
Check the machine 1,
Click on the LAN section "Advanced"
View the second machine. Click Lan section (s)
Ping yourself through
Check the first one.
IP is gone.
The IP was not found.
10.17 iptables NAT Table Application
Windows Ping does not pass 192.168.100.1 and 192.168.100.100
To view the gateway, run the following command.
No gateways
Set the gateway and run the following command.
Can ping through
Set up DNS. 119.29.29.29 is a public DNS.
Can ping the DNS, you can ping the outside network.
Only 1 IP
Cannot ping pass.
A machine equivalent to a router, B machine equivalent to a router phone, computer, can now be networked.
10.18 iptables NAT Table Application
Windows cannot ping through 192.168.100.100
Each operation needs to be in the virtual machine inside, want to telnet to it.
Can even a machine, from machine a jump to machine B, which is called port mapping, through the A machine port 22 mapped out, already has 1 Port 22, to map to 1122.
The steps are as follows:
1. Turn on route forwarding.
Had just been done, omitted.
2, first to delete the previous rules, so as not to affect the operation.
See the Rules table for any rules.
3. Add two Rules
1) put windows in the package, send to 192.168.133.130, Port is 1122, forward to 192.168.100.100:22,
2) The source IP of the package, let Windows know where it came from.
3) Add the gateway. I've just been working on it.
Verify it.
Create a new session, enter the host and port number.
Connection
Linux Seven week four lessons (March 22)