Networking question
Mark Haney
mhaney at ercbroadband.org
Thu Oct 16 11:36:32 UTC 2008
Rashkae wrote:
> Mark Haney wrote:
>> Paolo wrote:
>>> Hello,
>>>
>>> My connection to a Windows LAN is provided by a script which I was given, but
>>> don't understand, and which I've been using on Gutsy and Hardy.
>>>
>>> Now it also seems to be working on Intrepid, but I wonder if, with the new
>>> networking capabilities of Intrepid, it is possible to do the configuration
>>> directly in the Network Manager?
>>>
>>> The script is saved as /etc/dhcp3/dhclient-exit-hooks.d/cfg_static_routes
>>> and looks like this:
>>>
>>> #!/bin/sh
>>> # Add routes obtained by DHCP
>>> function process_static_routes() {
>>> while [ $# -ne 0 ]
>>> do
>>> host=$1
>>> gateway=$2
>>> shift; shift
>>> echo "add -host $host gw $gateway"
>>> route add -host $host gw $gateway
>>> done
>>> }
>>> if [ "$reason" = "BOUND" ]|| [ $reason == "REBOOT" ]
>>> then
>>> # echo "static_routes = $new_static_routes"
>>> process_static_routes $new_static_routes
>>> fi
>>>
>>> If anyone has some advice on what to try, I'd be grateful.
>>>
>>> Paolo
>>>
>>>
>>>
>> I'm not exactly sure what you're trying to do with this. Or even why
>> you need it. With DHCP, once you get an IP address, you'll also get a
>> default gateway. All that does is tell your system if the system
>> doesn't know where a packet goes, to shove it to the default. I've
>> NEVER needed to do this with DHCP, as it will provide basic networking
>> functionality when you request the IP address. Otherwise, what would be
>> the point of DHCP?
>>
>
> mark, you missed the point of this entirely.
No, I didn't miss it.
>
> His DHCP config is specifying static routes to individual hosts. These
> are hosts that are on a different subnet not connected to his default
> gateway.
Part of the reason it seems like I overlooked something is because,
while I did consider that as a possibility, I didn't think it likely,
mainly because it looked as if the hosts needing the routes weren't
necessarily on a different default gw, so much as they were obviously
DHCP themselves and would need a mechanism similar to DNS to be able to
get to them. I saw this set a LONG time ago in one of my first IT jobs.
(Of course, that doesn't mean I'm right, just that I looked at it from a
different angle.)
>
> Why the network would be set up this way is a mystery.. Apparently
> windows itself doesn't even support static routes to hosts in it's DHCP
> client. And it's a pain in the ass because the DHCP spec doesn't even
> support stateless subnets for this purpose. (You can't specify a
> netmask range, you have to provide a gateway for each host, even if it's
> the same gateway)
>
>
>
No, Windows doesn't support static routes in it's DHCP client, that's
why is has DNS (and previously, WINS) for those types of functions. Not
to mention if any hosts need to be known by name, they really should
have static IPs.
--
Libenter homines id quod volunt credunt -- Caius Julius Caesar
Mark Haney
Sr. Systems Administrator
ERC Broadband
(828) 350-2415
Call (866) ERC-7110 for after hours support
More information about the ubuntu-users
mailing list