![]() |
|
||||
LynxOS Networking Guide |
Network Security
This chapter provides an overview of the network security components provided with LynxOS, including:
Firewalls
LynxOS TCP/IP provides network protection from external intrusion with the incorporation of firewalls. Firewalls provide system administrators the ability to allow or deny the forwarding of packets through a network. Both inclusive and exclusive rule sets can be implemented, and protection from spoofing and bandwidth limitation can also be set. LynxOS supports the packet filter ipfw utility.
ipfw
IPFW is a kernel-based utility that is used to provide packet filtering and counting. Using a set of user-defined rules, IPFW controls whether or not network packets are forwarded or blocked. These user-defined rules, also called a firewall chain (or rule chain), can block or allow specific requests from specific hosts.
The user utility ipfw(8) is used as an interface to the IPFW kernel component.
ipfw can be set up to monitor both incoming and outgoing connections.
Enabling ipfw
Changing ipfw Rules
The ipfw user command is used to set the packet filter rules. Adding a rule with the ipfw command updates the current firewall chain. The simplest usage syntax is as follows:
The following table defines each of the arguments for ipfw.
For example, to set up a rule to deny all incoming packets from the address 192.168.1.1 to the address 192.168.2.2 over TCP/IP would be as follows:
To deny packets from the Ethernet port 1 to the telnet port (port 23) of 192.168.1.1, the command is:
Listing ipfw Rules
The current set of ipfw rules is displayed with the list argument:
Removing ipfw Rules
The flush argument to ipfw removes all rules currently set for packet filtering.
Clearing ipfw Counters
ipfw counters setup with the count option can be cleared with the zero argument to ipfw:
<index> affects only the counter at the index number specified. If <index> is not used, all packet counters are cleared.
ip6fw
The ip6fw utility is an IPv6 implementation of IPFW. The syntax and usage is identical to IPFW, with the following exceptions to the <protocol> option:
IPsec
IPsec is a security protocol in the IP layer that provides a secure means of communications between two hosts. IPsec can create a tunnel between subnets (tunnel mode) or provide security between two hosts directly (transport mode.) Hosts resolve the encryption keys and certification allowing for encrypted packets to be exchanged. Security information can be exchanged manually, or automated with the racoon daemon. Both IPv4 and IPv6 are supported.
IPsec policies are configured with the setkey(8) utility. See "Using setkey" for additional information.
AH and ESP Security Protocols
IPsec uses two security protocols:
AH contains hashes of data identification in the header, protecting the source and destination addresses of the packet. A shared secret between hosts ensure that packets are sent and received from the right system.
The ESP header allows for encryption or decryption of the packet by a shared secret between hosts.
Tunnel Mode and Transport Mode
IPsec includes two modes of communicating packets:
- Tunneling -- A connection between two systems on the same subnet. Typically, IPsec is used in tunnel mode to establish a VPN. In tunnel mode, IPsec encrypts the payload, and encapsulates it in a packet before sending it to the host.
- Transport -- A connection between two systems, where the payload for IPsec packets are encrypted. In transport mode, IPsec appends outgoing IP packets with a security protocol header. The IPsec header is determined by the original packet, and security information is included by the packet header.
Setting the Security Policy Database (SPD)
A (SPD) Security Policy Database is kept in the kernel that determines what encryption algorithms should be used, the security protocol to use (AH or ESP), and what packets to encrypt. The utility setkey(8) is used to modify the policies kept in the SPD.
Setting the Security Association Database (SAD)
The encryption keys used in secure transactions are kept in the kernel table called SAD (Security Association Database). The SAD contains the list of keys that are required for secure communications. The SAD can be manually updated with the setkey(8) utility. For hosts supporting IKE (Internet Key Exchange), the SAD can be automatically updated with the racoon daemon.
Using setkey
The setkey utility, invoked with the -c option, reads commands from standard input. Invoked with the -f option, setkey reads commands from a filename. The syntax used with setkey is as follows:
The ipfw syntax is as follows:
<command> <src_addr> <dest_addr> <protocol> <spi> \ [<extension>] <algorithm> [-P <policy>]
The following table describes the available commands and arguments:
The following commands and files provide an example of using setkey for updating the SAD and SPD kernel tables. The following instructions must be completed for both systems using IPsec.
- Create a file that contains the policies for SAD. In the example file below, two hosts (192.168.0.1 and 192.168.0.2) are enabled to use the 3des-cbc encryption algorithm using ESP. The first two lines enable the source and destination addresses, the last line updates the SPD table
For Host B, use the following (note the spdadd change):
Sample Configuration File (hostB.sample.policies)
Additional configuration details are available in the setkey(8) man page. Also, refer to the racoon utility man page for information on automating the SAD update.
![]() LynuxWorks, Inc. 855 Branham Lane East San Jose, CA 95138 http://www.lynuxworks.com 1.800.255.5969 |
![]() |
![]() |
![]() |
![]() |