DA-710 Series Linux
Managing Communications
3-16
Example 5: Drop TCP packets addressed for port 21.
# iptables –A INPUT –i eth0 –p tcp --dport 21 –j DROP
Example 6: Accept TCP packets from 192.168.0.24 to DA-710-I-LX’s port 137, 138, 139
# iptables –A INPUT –i eth0 –p tcp –s 192.168.0.24 --dport 137:139 –j ACCEPT
Example 7: Log TCP packets that visit DA-710-I-LX’s port 25.
# iptables –A INPUT –i eth0 –p tcp --dport 25 –j LOG
Example 8: Drop all packets from MAC address 01:02:03:04:05:06.
# iptables –A INPUT –i eth0 –p all –m mac --mac-source 01:02:03:04:05:06 –j DROP
ATTENTION
In Example 8, remember to issue the command
# modprobe ipt_mac
first to load the module
ipt_mac
.
NAT (Network Address Translation)
The NAT (Network Address Translation) protocol translates IP addresses used on one network into IP addresses
used on a connecting network. One network is designated the inside network and the other is the outside
network. Typically, the DA-710-LX connects several devices on a network and maps local inside network
addresses to one or more global outside IP addresses, and un-maps the global IP addresses on incoming
packets back into local IP addresses.
ATTENTION
Click on the following links for more information about NAT.
http://www.netfilter.org/documentation/HOWTO//packet-filtering-HOWTO.html
NAT Example
The IP address of all packets leaving LAN1 are changed to
192.168.3.127
(you will need to load the module
ipt_MASQUERADE
):