On Mon, Nov 30, 2009 at 9:16 PM, Moritz Herrmann
<herrmann.mor...@gmail.com> wrote:
> Hello misc,
> I am using OBSD on my Laptop and as I use internet
> connections at different places (home, work, university),
> I always have to change my ip-adress and default route after startup.

I had the same problem and as I'm not in charge of the dhcp server anymore
(for a static assignment), I used a feature of dhclient(8): static leases.

In my dhclient.conf(5) I have this:

lease {
  fixed-address 172.16.123.222;
  option subnet-mask 255.255.255.0;
  option routers 172.16.123.1;
  option domain-name-servers 172.16.1.1;
  option domain-name "example.com";
  renew 0 2012/12/31 23:59:59;
  rebind 0 2012/12/31 23:59:59;
  expire 0 2012/12/31 23:59:59;
}

This way, when I am in the 172.16.123/24 subnet, without a dhcp server
(or with a
"reject" clause in dhclient.conf), dhclient tries this lease and, if
it works, it is used.

You can have one for every network you connect to. Of course it is
simpler if those
network do not share the same characteristics... :-)

HTH.

Ciao,
D.

Reply via email to