.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd June 7, 2012
+.Dd October 11, 2012
.Dt DHCPCD 8
.Os
.Sh NAME
.Nm dhcpcd
-.Nd an RFC 2131 compliant DHCP client
+.Nd a DHCP client
.Sh SYNOPSIS
.Nm
-.Op Fl ABbDdEGgHJKkLnpqTVw
+.Op Fl 46ABbDdEGgHJKkLnpqTVw
.Op Fl C , Fl Fl nohook Ar hook
.Op Fl c , Fl Fl script Ar script
.Op Fl e , Fl Fl env Ar value
configured exactly how the the DHCP server wants.
Here are some options that deal with turning these bits off.
.Bl -tag -width indent
+.It Fl 4 , Fl Fl ipv4only
+Only configure IPv4.
+.It Fl 6 , Fl Fl ipv6only
+Only configure IPv6.
.It Fl A , Fl Fl noarp
Don't request or claim the address by ARP.
This also disables IPv4LL.
free(iface->clientid);
iface->clientid = NULL;
+ if (!(ifo->options & DHCPCD_IPV4))
+ return;
+
if (*ifo->clientid) {
iface->clientid = xmalloc(ifo->clientid[0] + 1);
memcpy(iface->clientid, ifo->clientid, ifo->clientid[0] + 1);
start_static(iface);
return;
}
+ if (!(ifo->options & DHCPCD_IPV4))
+ return;
if (ifo->options & DHCPCD_INFORM) {
start_inform(iface);
return;
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd May 21, 2012
+.Dd October 11, 2012
.Dt DHCPCD.CONF 5 SMM
.Os
.Sh NAME
If
.Ar hostname
is a FQDN (ie, contains a .) then it will be encoded as such.
+.It Ic ipv4only
+Only configure IPv4.
+.It Ic ipv6only
+Only configure IPv6.
.It Ic fqdn Op none | ptr | both
none disables FQDN encoding, ptr just asks the DHCP server to update the PTR
record of the host in DNS whereas both also updates the A record.
Set this option so to make
.Nm dhcpcd
always fork on an RA.
-.It ic ipv6ra_own
+.It Ic ipv6ra_own
Disables kernel IPv6 Router Advertisment processing so dhcpcd can manage
addresses and routes.
-.It ic ipv6ra_own_default
+.It Ic ipv6ra_own_default
Each time dhcpcd receives an IPv6 Router Adveristment, dhcpcd will manage
the default route only.
This allows dhcpcd to prefer an interface for outbound traffic based on metric
and/or user selection rather than the kernel.
-.It ic ipv6rs
+.It Ic ipv6rs
Enables IPv6 Router Advertisment solicitation.
This is on by default, but is documented here in the case where it is disabled
globally but needs to be enabled for one interface.
{"ipv6ra_fork", no_argument, NULL, O_IPV6RA_FORK},
{"ipv6ra_own", no_argument, NULL, O_IPV6RA_OWN},
{"ipv6ra_own_default", no_argument, NULL, O_IPV6RA_OWN_D},
+ {"ipv4only", no_argument, NULL, '4'},
+ {"ipv6only", no_argument, NULL, '6'},
{NULL, 0, NULL, '\0'}
};
case 'Z':
ifdv = splitv(&ifdc, ifdv, arg);
break;
+ case '4':
+ ifo->options &= ~(DHCPCD_IPV6 | DHCPCD_IPV6RS);
+ ifo->options |= DHCPCD_IPV4;
+ break;
+ case '6':
+ ifo->options &= ~DHCPCD_IPV4;
+ ifo->options |= DHCPCD_IPV6 | DHCPCD_IPV6RS;
+ break;
case O_ARPING:
if (parse_addr(&addr, NULL, arg) != 0)
return -1;
/* Seed our default options */
ifo = xzalloc(sizeof(*ifo));
+ ifo->options |= DHCPCD_IPV4 | DHCPCD_IPV4LL;
ifo->options |= DHCPCD_GATEWAY | DHCPCD_DAEMONISE | DHCPCD_LINK;
- ifo->options |= DHCPCD_ARP | DHCPCD_IPV4LL;
- ifo->options |= DHCPCD_IPV6RS | DHCPCD_IPV6RA_REQRDNSS;
+ ifo->options |= DHCPCD_ARP;
+ ifo->options |= DHCPCD_IPV6 | DHCPCD_IPV6RS | DHCPCD_IPV6RA_REQRDNSS;
ifo->timeout = DEFAULT_TIMEOUT;
ifo->reboot = DEFAULT_REBOOT;
ifo->metric = -1;
/* Don't set any optional arguments here so we retain POSIX
* compatibility with getopt */
-#define IF_OPTS "bc:de:f:gh:i:kl:m:no:pqr:s:t:u:v:wxy:z:ABC:DEF:GHI:JKLO:Q:S:TUVW:X:Z:"
+#define IF_OPTS "46bc:de:f:gh:i:kl:m:no:pqr:s:t:u:v:wxy:z:ABC:DEF:GHI:JKLO:Q:S:TUVW:X:Z:"
#define DEFAULT_TIMEOUT 30
#define DEFAULT_REBOOT 5
#define DHCPCD_IPV6RA_OWN_DEFAULT (1ULL << 34)
#define DHCPCD_IPV4 (1ULL << 35)
#define DHCPCD_FORKED (1ULL << 36)
+#define DHCPCD_IPV6 (1ULL << 37)
extern const struct option cf_options[];
handle_flag:
if (rap->flags & (ND_RA_FLAG_MANAGED | ND_RA_FLAG_OTHER)) {
if (new_data)
- syslog(LOG_WARNING, "%s: no support for DHCPv6 management",
+ syslog(LOG_WARNING,
+ "%s: no support for DHCPv6 management",
ifp->name);
if (options & DHCPCD_TEST)
exit(EXIT_SUCCESS);