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:[email protected]]
LinkedIn: http://it.linkedin.com/in/delaurenzis