Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Commands & Shells, Networking

Using IPTables to Allow Access to Private Networks

Submitted by on June 22, 2017 – 9:46 am

Below is a quick example of how to use iptables to allow port access for all types of private networks. In this case we’re allowing access to ports 10000 and 20000, commonly used by webmin and usermin.

for i in 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16; do
for j in 10000 20000; do
iptables -A INPUT -p tcp --dport ${j} -s ${i} -j ACCEPT
done; done
iptables -S && /sbin/iptables-save && /sbin/service iptables save

 

Print Friendly, PDF & Email

Leave a Reply