In this article, I will show examples of blocking MAC addresses in IPTables.Continue reading “IPTables. Blocking by MAC address”
In this article, I will describe several options for saving IPTables rules so that they load when the operating system starts.Continue reading “How to save IPTables rules”
I will give an example of IPTables rules for BGP.Continue reading “IPTables Rules for BGP”
In this article, I will give an example of IPTables rules for SNMP.
Let’s say “iptables -P INPUT DROP” is the default, which is very desirable.
Sometimes it is necessary, for example, to delete all IPTables rules and to add only the necessary, so for convenience, you can specify them in the script, and then execute it.Continue reading “IPTables quick setup script”
IPTables is a command line utility that is the standard interface for managing the firewall.Continue reading “How to configure IPTables”
Suppose the default “iptables -P INPUT ACCEPT” for all connections (and if DROP, which is very desirable, then we do not use all the DROP rules below, we only perform ACCEPT).
Since Asterisk AMI usually works on TCP port 5038, in order to open it we will execute:Continue reading “IPTables rules for Asterisk AMI”
ipset – a tool consisting of a kernel module, libraries and utility, allowing you to organize a list of networks, IP or MAC addresses, etc., which is very convenient to use for example with IPTables.
Installation command in Ubuntu:
Suppose INPUT is the default DROP, I’ll give examples of IPTables rules for FreeRADIUS:
iptables -A INPUT -p udp --dport 1812 -j ACCEPT iptables -A INPUT -p udp --dport 1813 -j ACCEPT
Once on one of the NAT servers I needed to block some sites.
If the sites are located on several IP addresses, then you need to find out these ranges of IP addresses, for example, look for VKontakte on bgp.he.net, for example, a list of subnets for one of the AS belonging to VK “http://bgp.he.net/AS47541#_prefixes”.
When networks or hosts are known, add rules for them in iptables, for example:
/sbin/iptables -A FORWARD -s 220.127.116.11/18 -j DROP /sbin/iptables -A FORWARD -s 18.104.22.168/20 -j DROP
Thus, we prohibit the passage of the traffic of these networks through the server.