The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Saturday, April 19, 2003

Network anomalies solved

The issues I was having with DHCP were getting to me.

I decided that since I was having problems with janet serving up DHCP for the wireless network, that I would have the WAP do that for me, since it had the functionality. Might as well use it.

Funny thing about the WAP though; being too friendly it's actually hostile to how I run the network here in the Facility in the Middle of Nowhere.

I enabled the DHCP server, and while I was able to have it assign my laptop an IP address, the WAP wasn't forwarding packets to janet so I couldn't see the Internet.

If I assigned a static IP address (and assigned the IP route) on the laptop, I could get out on the Internet.

It seems that the WAP wanted to route all the traffic out its WAN port, which in this case, is the port you would normally plug your DSL or cable modem into. But since I already have a machine acting as a firewall/NAT, this port on the WAP is empty.

Although if I change the configuration of the WAP from a “gateway” to a “router” the DHCP assigned IP address is routed correctly, but then the DHCP server on the WAP mysteriously stops working.

So … I can have the WAP serve up DHCP, but those addresses aren't routable, or I can have the addresses routable but can't assign them via DHCP. I just love how this stuff works so flawlessly.

So then I'm back to figuring out why DHCP on janet isn't working. Putting the DHCP server into debug mode, I see that it can see the request, but for some strange reason it can't send the response, saying that the network is unreachable. Which is odd, because the network is reachable.

DHCP works fine on linus, my development machine. And the only difference between the two is the number of NICs—one in linus, three in janet. Suspecting that there might be a problem with the Linux 2.0 networking stack, I disable the other two NICs in janet and suddenly, the DHCP server works! And with the WAP in “router” mode, janet sees the DHCP requests from the wireless side of the network.

Now, since I have RedHat 5.2 installed on these systems, and I still have the installation CDs, I pulls the source code (one of the wonders of open source) for the DHCP server and start poking around.

LINUX

There are three big LINUX issues: the all-ones broadcast address, Linux 2.1 ip_bootp_agent enabling, and operations with more than one network interface.

BROADCAST

In order for dhcpd to work correctly with picky DHCP clients (e.g., Windows 95), it must be able to send packets with an IP destination address of 255.255.255.255. Unfortunately, Linux insists on changing 255.255.255.255 into the local subnet broadcast address (here, that's 192.5.5.223). This results in a DHCP protocol violation, and while many DHCP clients don't notice the problem, some (e.g., all Microsoft DHCP clients) do. Clients that have this problem will appear not to see DHCPOFFER messages from the server.

It is possible to work around this problem on some versions of Linux by creating a host route from your network interface address to 255.255.255.255. The command you need to use to do this on Linux varies from version to version. The easiest version is:

route add -host 255.255.255.255 dev eth0

MULTIPLE INTERFACES

Most older versions of the Linux kernel do not provide a networking API that allows dhcpd to operate correctly if the system has more than one broadcast network interface. However, Linux 2.0 kernels with version numbers greater than or equal to 2.0.31 add an API feature: the SO_BINDTODEVICE socket option. If SO_BINDTODEVICE is present, it is possible for dhcpd to operate on Linux with more than one network interface. In order to take advantage of this, you must be running a 2.0.31 or greater kernel, and you must have 2.0.31 system headers installed before you build dhcpd.

README for dhcp-2.0b1pl6

Fortunately, since RedHat 5.2 came bundled with Linux 2.0.36, dhcpd was compiled to handle multiple interfaces. All I had to do was add the appropriate route commands to have it work; I can now have DHCP serve up addresses for both the LAN and wireless network.

Gregory (who came over tonight) also realized that his wireless card in his laptop just doesn't work with my WAP—he was able access the WAP using my wireless network card.

Gotta love i14y.

Obligatory Picture

[The future's so bright, I gotta wear shades]

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site: https://boston.conman.org/, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

https://boston.conman.org/2000/08/01

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.