You can log into your router manually and look around for the firmware number using your web browser. It is always displayed somewhere, but every router is different. If you need help finding your firmware version, that is a great question to ask in the Portforward Support System.
Firewalls make it possible to filter the incoming and outgoing traffic that flows through a system.A firewall can use one or more sets of "rules" to inspect network packets as they come in or go out of network connections and either allows the traffic through or blocks it.The rules of a firewall can inspect one or more characteristics of the packets such as the protocol type, source or destination host address, and source or destination port.
Support network address translation (NAT), which allows an internal network to use private IP addresses and share a single connection to the public Internet using either a single IP address or a shared pool of automatically assigned public addresses.
FreeBSD has three firewalls built into the base system: PF, IPFW, and IPFILTER, also known as IPF.FreeBSD also provides two traffic shapers for controlling bandwidth usage: altq(4) and dummynet(4).ALTQ has traditionally been closely tied with PF and dummynet with IPFW.Each firewall uses rules to control the access of packets to and from a FreeBSD system, although they go about it in different ways and each has a different rule syntax.
A ruleset contains a group of rules which pass or block packets based on the values contained in the packet.The bi-directional exchange of packets between hosts comprises a session conversation.The firewall ruleset processes both the packets arriving from the public Internet, as well as the packets produced by the system as a response to them.Each TCP/IP service is predefined by its protocol and listening port.Packets destined for a specific service originate from the source address using an unprivileged port and target the specific service port on the destination address.All the above parameters can be used as selection criteria to create rules which will pass or block services.
FTP has two modes: active mode and passive mode.The difference is in how the data channel is acquired.Passive mode is more secure as the data channel is acquired by the ordinal ftp session requester.For a good explanation of FTP and the different modes, see
A firewall ruleset can be either "exclusive" or "inclusive".An exclusive firewall allows all traffic through except for the traffic matching the ruleset.An inclusive firewall does the reverse as it only allows traffic matching the rules through and blocks everything else.
An inclusive firewall offers better control of the outgoing traffic, making it a better choice for systems that offer services to the public Internet.It also controls the type of traffic originating from the public Internet that can gain access to a private network.All traffic that does not match the rules is blocked and logged.Inclusive firewalls are generally safer than exclusive firewalls because they significantly reduce the risk of allowing unwanted traffic.
Security can be tightened further using a "stateful firewall".This type of firewall keeps track of open connections and only allows traffic which either matches an existing connection or opens a new, allowed connection.
Stateful filtering treats traffic as a bi-directional exchange of packets comprising a session.When state is specified on a matching rule the firewall dynamically generates internal rules for each anticipated packet being exchanged during the session.It has sufficient matching capabilities to determine if a packet is valid for a session.Any packets that do not properly fit the session template are automatically rejected.
Stateful filtering allows one to focus on blocking/passing new sessions.If the new session is passed, all its subsequent packets are allowed automatically and any impostor packets are automatically rejected.If a new session is blocked, none of its subsequent packets are allowed.Stateful filtering provides advanced matching abilities capable of defending against the flood of different attack methods employed by attackers.
NAT stands for Network Address Translation.NAT function enables the private LAN behind the firewall to share a single ISP-assigned IP address, even if that address is dynamically assigned.NAT allows each computer in the LAN to have Internet access, without having to pay the ISP for multiple Internet accounts or IP addresses.
NAT will automatically translate the private LAN IP address for each system on the LAN to the single public IP address as packets exit the firewall bound for the public Internet.It also performs the reverse translation for returning packets.
When working with the firewall rules, be very careful.Some configurations can lock the administrator out of the server.To be on the safe side, consider performing the initial firewall configuration from the local console rather than doing it remotely over ssh.
The FreeBSD packet filter mailing list is a good place to ask questions about configuring and running the PF firewall.Check the mailing list archives before asking a question as it may have already been answered.
PF will not start if it cannot find its ruleset configuration file.By default, FreeBSD does not ship with a ruleset and there is no /etc/pf.conf.Example rulesets can be found in /usr/share/examples/pf/.If a custom ruleset has been saved somewhere else, add a line to /etc/rc.conf which specifies the full path to the file:
By default, PF reads its configuration rules from /etc/pf.conf and modifies, drops, or passes packets according to the rules or definitions specified in this file.The FreeBSD installation includes several sample files located in /usr/share/examples/pf/.Refer to the PF FAQ for complete coverage of PF rulesets.
To keep an eye on the traffic that passes through the PF firewall, consider installing the sysutils/pftop package or port.Once installed, pftop can be run to view a running snapshot of traffic in a format which is similar to top(1).
The simplest possible ruleset is for a single machine that does not run any services and which needs access to one network, which may be the Internet.To create this minimal ruleset, edit /etc/pf.conf so it looks like this:
The first rule denies all incoming traffic by default.The second rule allows connections created by this system to pass out, while retaining state information on those connections.This state information allows return traffic for those connections to pass back and should only be used on machines that can be trusted.The ruleset can be loaded with:
In addition to keeping state, PF provides lists and macros which can be defined for use when creating rules.Macros can include lists and need to be defined before use.As an example, insert these lines at the very top of the ruleset:
PF understands port names as well as port numbers, as long as the names are listed in /etc/services.This example creates two macros.The first is a list of seven TCP port names and the second is one UDP port name.Once defined, macros can be used in rules.In this example, all traffic is blocked except for the connections initiated by this system for the seven specified TCP services and the one specified UDP service:
Even though UDP is considered to be a stateless protocol, PF is able to track some state information.For example, when a UDP request is passed which asks a name server about a domain name, PF will watch for the response to pass it back.
Including -n causes the rules to be interpreted only, but not loaded.This provides an opportunity to correct any errors.At all times, the last valid ruleset loaded will be enforced until either PF is disabled or a new ruleset is loaded.
This section demonstrates how to configure a FreeBSD system running PF to act as a gateway for at least one other machine.The gateway needs at least two network interfaces, each connected to a separate network.In this example, xl0 is connected to the Internet and xl1 is connected to the internal network.
Next, create the PF rules to allow the gateway to pass traffic.While the following rule allows stateful traffic from hosts of the internal network to pass to the gateway, the to keyword does not guarantee passage all the way from source to destination:
While these two rules will work, rules this specific are rarely needed.For a busy network admin, a readable ruleset is a safer ruleset.The remainder of this section demonstrates how to keep the rules as simple as possible for readability.For example, those two rules could be replaced with one rule:
The interface:network notation can be replaced with a macro to make the ruleset even more readable.For example, a $localnet macro could be defined as the network directly attached to the internal interface ($xl1:network).Alternatively, the definition of $localnet could be changed to an IP address/netmask notation to denote a network, such as 192.168.100.1/24 for a subnet of private addresses.
For dialup users, the external interface will use tun0.For an ADSL connection, specifically those using PPP over Ethernet (PPPoE), the correct external interface is tun0, not the physical Ethernet interface.
This ruleset introduces the nat rule which is used to handle the network address translation from the non-routable addresses inside the internal network to the IP address assigned to the external interface.The parentheses surrounding the last part of the nat rule ($ext_if) is included when the IP address of the external interface is dynamically assigned.It ensures that network traffic runs without serious interruptions even if the external IP address changes.
Note the quick keyword in this rule.Since the ruleset consists of several rules, it is important to understand the relationships between the rules in a ruleset.Rules are evaluated from top to bottom, in the sequence they are written.For each packet or connection evaluated by PF, the last matching rule in the ruleset is the one which is applied.However, when a packet matches a rule which contains the quick keyword, the rule processing stops and the packet is treated according to that rule.This is very useful when an exception to the general rules is needed.
b1e95dc632