On Mon, Apr 21, 2014 at 4:29 PM, Alessandro DE LAURENZIS <
just22....@gmail.com> wrote:

> Hello,
>
> 5.4-Rel here, GENERIC.MP kernel.
>
> Rather often I need to connect my laptop to networks without DHCP service
> (sometimes I use a direct connection through a crossover cable, too); so
> it would be nice to have a semi-automatic configuration procedure.
>
> I'm trying to exploit the dhclient's "lease declaration" feature; this
> is an excerpt of my /etc/dhclient.conf:
>
> # Lease declarations (fallback)
> lease {
>     interface "trunk0";
>     fixed-address 192.168.1.103;
>     option subnet-mask 255.255.255.0;
>     option routers 127.0.0.1;
>     option domain-name-servers 127.0.0.1;
>     option dhcp-lease-time 259200;
>     renew  4 2020/12/31 23:59:59 UTC;
>     rebind 4 2020/12/31 23:59:59 UTC;
>     expire 4 2020/12/31 23:59:59 UTC;
> }
>
> (note that I used the loopback address for routers and
> domain-name-servers fields, in order to bound them to something
> "ping-able"). When I connect the Eth i/f to a DHCP-less network and
> restart the service, I obtain:
>
> just22@poseidon:[~]> sudo sh /etc/netstart trunk0
> [...]
> DHCPREQUEST on trunk0 to 255.255.255.255 port 67
> DHCPREQUEST on trunk0 to 255.255.255.255 port 67
> DHCPREQUEST on trunk0 to 255.255.255.255 port 67
> [...]
> No acceptable DHCPOFFERS received.
> Trying recorded lease 192.168.1.103
> bound: renewal in 128358 seconds.
>
> So it seems that the lease has been obtained as expected; unfortunately,
> the interface is still not configured:
>
> just22@poseidon:[~]> ifconfig trunk0
> trunk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAS
>         lladdr 00:21:86:94:34:8e
>         priority: 0
>         trunk: trunkproto failover
>                 trunkport iwn0
>                 trunkport em0 master,active
>         groups: trunk egress
>         media: Ethernet autoselect
>         status: active
>         inet6 fe80::221:86ff:fe94:348e%trunk0 prefixlen
>
> Am I doing anything wrong? Is this an expected behavior? Could you point
> me in the right direction?
>
> Thanks in advance for your time and patience
>
> --
> Alessandro DE LAURENZIS
> [mailto:just22....@gmail.com]
> LinkedIn: http://it.linkedin.com/in/delaurenzis
>


>From man dhclient:

A mobile host which may sometimes need to access a network on which no
     DHCP server exists may be preloaded with a lease for a fixed address on
     that network.  When all attempts to contact a DHCP server have failed,
     *dhclient* will try to validate the static lease, and if it succeeds, it
     will use that lease until it is restarted.

 . First of all not good idea having router with 127..... and your IP
192... Give them same subnet. Second can you try with real interface
directly to skip trunk (if there's not something wrong with trunk itself)?
Third try to enable debug for dhclient and network interface if it does
show something more. Did you try if your config is working directly defined
in interface file and what it shows during debug run?
http://www.openbsd.org/faq/faq6.html#Setup

Reply via email to