5.2.2. Protect portmap With IPTables


To further restrict access to the portmap service, it is a good idea to add IPTables rules to the server and restrict access to specific networks.
Below are two example IPTables commands that allow TCP connections to the portmap service (listening on port 111) from the 192.168.0/24 network and from the localhost (which is necessary for the sgi_fam service used by Nautilus). All other packets are dropped.
 iptables -A INPUT -p tcp -s! 192.168.0.0/24 --dport 111 -j DROP iptables -A INPUT -p tcp -s 127.0.0.1 --dport 111 -j ACCEPT 
To similarly limit UDP traffic, use the following command.
 iptables -A INPUT -p udp -s! 192.168.0.0/24 --dport 111 -j DROP 

Note

Refer to Chapter 7, Firewalls for more information about implementing firewalls with IPTables commands.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.