Linux

Some iptables tricks

Multiport The Multiport extension allows you to specify multiple ports and ranges and makes it possible to create complex rules in one line. Here’s an example of how you can allow SSH, Web, IMAP and X terminal traffic iptables -A INPUT -p tcp -m multiport –dports 22,80,143,6000:6003 -j ACCEPT The alternative to using this rule […]

Read More
Network

Using ufw / iptables in Ubuntu 8.04 LTS

ufw (Uncomplicated Firewall) is a new and easy firewall/iptables tool introduced in Ubuntu 8.04 LTS (Hardy Heron). ufw is a front-end for iptables-restore, with its rules saved in /etc/ufw/before.rules, /etc/ufw/after.rules and /var/lib/ufw/user.rules. Administrators can customize before.rules and after.rules as desired using the standard iptables-restore syntax. Rules are evaluated as follows: before.rules first, user.rules next, and […]

Read More
Network

Rate-limit the amount of iptables logging

It is a good idea to place a log chain just above your drop or reject rule and usually you would do a -A INPUT -j LOG The above rule can cause flooding your system. You should instead use the following iptables rule to avoid your logs being flooded and DDOS’ing -A INPUT -m limit […]

Read More
Linux

Determine which interface is eth0

It can sometimes be difficult to determine which networcard is eth0, eth1 and so on. A easy way to determine it is to use the ethtool command ethtool -p eth0 10 This makes the network cards LED blink for 10 seconds, and this happens without interrupting the network traffic. You do offcourse need physical access […]

Read More