Installation on the OpenBSD box was easy. It is a firewall so it was two NICs. I plugged the router into the "external" NIC, ran dhcpd, fixed my caching nameserver to point to Frontier's DNS servers and I was able to get an address. However, I still needed to authenticate in order to access anything but the authentication server. Luckily, Frontier's authentication system is simple. I'll discuss it in the next section.
First, you need to authenticate with the DSL service. The following procedure accomplishes this.
| fcn | parameter | value |
| accountLogon | username | username |
| password | password |
| fcn | parameter | value |
| serviceLogon | service | frontiernet.dsl |
Finally, to log off the service:
| fcn | parameter | value |
| accountLogoff | ||
| accountLogoff | yes | Yes |
I've included the program I use to handle authentication. It is written in Python and requires the urllib module. This module should be installed by default on any v1.5 or later distribution of Python. Edit the file to set your username and password (near the top). The following are valid options:
Also, the utility currently does no error checking or validation. The only way to know if you logged on successfully is to try and access a net resource. When I have some time I'll add some simple error checking. I also intend to add support for different, or multiple service providers. The servlet also provides statistical information on the current session. I would like to add a -query option to support this. If you would like to be informed of future updates, send me some mail.
My DSL router is connected to a Cisco Catalyst 2100 switch. My "external" exthernet card is connected to the switch and exists in the same VLAN as the router. This allows me to easily add a machine to the DMZ if, for example, I decide to move my web server to a separate IP address. The "internal" NIC on my firewall is attached to a separate VLAN on the switch and all the other machines on the internal network are also connected to this VLAN. The firewall also runs a name server. This is primarily a caching name server but contains entries for all my computers that resolve to internal (192.168.60.x) addresses. My primary name server, located at granite canyon contains entries for these machines that resolve to the firewall's external IP address.
I use a fairly simple /etc/ipnat.rules file. First, I created a file called /etc/ipnat.template as follows.
rdr ep0 NEWIP/32 port www -> meth.wopr.org port www
rdr ep0 NEWIP/32 port 2222 -> meth.wopr.org port ssh
rdr ep0 NEWIP/32 port 2223 -> speed.wopr.org port ssh
rdr ep0 NEWIP/32 port 7777 -> meth.wopr.org port 7777
rdr ep0 NEWIP/32 port 8227 -> meth.wopr.org port 23
rdr ep0 NEWIP/32 port 6112 -> crack.wopr.org port 6112
map ep0 192.168.60.0/24 -> NEWIP/32 portmap tcp/udp 10000:20000
map ep0 192.168.60.0/24 -> NEWIP/32
This forwards some select ports such as ssh and http to the appropriate
machines. Only established connections and the above mentioned special
cases are allow through the firewall. Traffic from firewalled machines to
the internet is unrestricted. I then edited the dhclient-script file
which is run after dhclient obtains a DHCP lease. After the default
route is added, I run the command:
sed -e "s/NEWIP/$new_ip_address/g" /etc/ipnat.template > /etc/ipnat.rules
This generates a valid /etc/ipnat.rules. I decided to do things this
way instead of specifying just an interface in the /etc/ipnat.rules
file for a couple of reasons. When I started using ipnat, it was not
completly functional and it did not always work correctly if I didn't
specify an IP address. Also, it is very easy for me to determine where and
when dhclient failed if I was unable to obtain an address. Both
these reasons are relics of an older system and I will probably do things
differently when I next do a clean install of the operating system. Never
the less, some people may find this information of some use.The firewall also runs snort to detect intrusion attempts. However, people seemed to have figured out that OpenBSD is very secure so my IDS doesn't see much activity these days. I have a very basic SOCKS firewall set up but it is rarly running. It sees very little use so it usually just loads down my system and poses another possible security hole.
Running on an Intel 486 DX4 66MHz machine, I can sustain 2 MB throughput. This is more data that the ADSL link can handle so it is more than acceptable. In the near future, I will be upgrading to a Cyrix P200+ MMX machine. This machine will also function as a web server and a file server.
This network setup runs efficiently and is secure enough for a small home network consisting of a couple of Windows machines, a small file server, a small web and database server, and a few SUN IPC workstations.