Linux Server How ToHow To Setup, Configure, Manage and Secure a Linux Server |
|
Home Which Linux Distribution? Linux Server Hardware Linux Server Security Linux Server Security Linux Server Firewalls Easy Firewall Generator IPTABLES Firewall Tutorial Ubuntu Server Firewall Secure Passwords Install John the Ripper Keep Your Server Updated Linux Web Server - Apache Linux DNS Server - Bind Linux DHCP Server - DHCPD Linux Mail Server - Sendmail LDP How To's About This Site |
Linux Server Security - Ubuntu's ufw Firewall Configuration ToolUFW - The Uncomplicated FirewallUFW is the default firewall configuration tool for Ubuntu Linux. UFW provides a more user friendly way to create a host-based firewall though some knowledge of services and the various ports they run on is still required. This information is contained in the file /etc/services and ufw refers to this to determine what ports a service requires, so there is no harm in the end user doing the same. Many Linux administrators refer to /etc/services to determine what ports a service requires and indeed the purpose of the file is to map port numbers and protocols to service names.Although ufw is not intended to provide complete firewall functionality it can be used to create simple rules that may be all your Linux server requires to protect it from the undesirables, ufw falls short as far as complex gateway packet filtering is concerned. Many rules can be added to the firewall using the ufw command and anything that cant can be added to the ufw configuration files directly using a text editor such as vi or pico. Ufw's configuration files are located in /etc/ufw.
To open access to a particular port, in this instance port 80 which is used for a webserver
To remove a rule, in this instance access to port 80
Or to deny access to a port
You can even specify a service name as specified in /etc/services
More complex rules are well within ufw's scope using a wider syntax. The following denies tcp traffic from anywhere to port 80 on this host.
The following rules permit tcp connections from anywhere to ports 80, 443 and all ports 8080-8090 inclusive on the host Linux server.
This will prevent traffic from the entire class C network 192.168.10.0-255 to 192.168.0.1 port 25. Useful for stopping spammers from sending email to your mailserver as an example.
You can allow access to your Linux server from a particular address range.
You can deny access to your Linux server from a particular address range.
Ufw also supports rate limiting, which is useful for limiting brute force login attacks and other unwanted traffic. Rate limiting steps in if an IP address initiates 6 or more connections within the last 30 seconds.
These are the main commands that you will require to configure a very usable firewall for your Ubuntu Linux server but ufw does have more to offer including masquerading, NAT and other features. Check out the IPTables tutorial for more uses for your firewall. |
| © 2009 www.linuxserverhowto.com |