start dhcpcd on specific interfaces only explicitly
On my machine I have multiple interfaces which often have a dhcp server running. I now want to react differently on various 'setups':
- when there is wifi, use wifi
- when there is ethernet, use ethernet (I have an extra profile there, too)
- when there is both, use one of them (or both, or whatever.. just work)
- when interface
usb0
orusb1
occur, only enable dhcp on them when someone issuesdhcpcd <interface>
My current dhcpcd.conf
looks like
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
#clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
duid
# Persist interface configuration when dhcpcd exits.
persistent
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
interface eth0
arping 192.168.1.77
profile 192.168.1.77
static ip_address=192.168.1.65
static routers=192.168.1.77
static domain_name_servers=192.168.1.77
interface usb0
nogateway
interface usb1
nogateway
The wifi/ethernet part seems to work, though I haven't tested it thoroughly. But I don't know, how to set up my usb interfaces to only respond to DHCP on command. The nogateway
is just there to prevent usb interfaces to screw up my default routes ATM.
How do I need to configure dhcpcd
?
Edit 1:
I am on a Gentoo system with no more network configuration except my wpa_supplicant.conf
network-interface dhcp
bumped to the homepage by Community♦ 13 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
On my machine I have multiple interfaces which often have a dhcp server running. I now want to react differently on various 'setups':
- when there is wifi, use wifi
- when there is ethernet, use ethernet (I have an extra profile there, too)
- when there is both, use one of them (or both, or whatever.. just work)
- when interface
usb0
orusb1
occur, only enable dhcp on them when someone issuesdhcpcd <interface>
My current dhcpcd.conf
looks like
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
#clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
duid
# Persist interface configuration when dhcpcd exits.
persistent
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
interface eth0
arping 192.168.1.77
profile 192.168.1.77
static ip_address=192.168.1.65
static routers=192.168.1.77
static domain_name_servers=192.168.1.77
interface usb0
nogateway
interface usb1
nogateway
The wifi/ethernet part seems to work, though I haven't tested it thoroughly. But I don't know, how to set up my usb interfaces to only respond to DHCP on command. The nogateway
is just there to prevent usb interfaces to screw up my default routes ATM.
How do I need to configure dhcpcd
?
Edit 1:
I am on a Gentoo system with no more network configuration except my wpa_supplicant.conf
network-interface dhcp
bumped to the homepage by Community♦ 13 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
On my machine I have multiple interfaces which often have a dhcp server running. I now want to react differently on various 'setups':
- when there is wifi, use wifi
- when there is ethernet, use ethernet (I have an extra profile there, too)
- when there is both, use one of them (or both, or whatever.. just work)
- when interface
usb0
orusb1
occur, only enable dhcp on them when someone issuesdhcpcd <interface>
My current dhcpcd.conf
looks like
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
#clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
duid
# Persist interface configuration when dhcpcd exits.
persistent
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
interface eth0
arping 192.168.1.77
profile 192.168.1.77
static ip_address=192.168.1.65
static routers=192.168.1.77
static domain_name_servers=192.168.1.77
interface usb0
nogateway
interface usb1
nogateway
The wifi/ethernet part seems to work, though I haven't tested it thoroughly. But I don't know, how to set up my usb interfaces to only respond to DHCP on command. The nogateway
is just there to prevent usb interfaces to screw up my default routes ATM.
How do I need to configure dhcpcd
?
Edit 1:
I am on a Gentoo system with no more network configuration except my wpa_supplicant.conf
network-interface dhcp
On my machine I have multiple interfaces which often have a dhcp server running. I now want to react differently on various 'setups':
- when there is wifi, use wifi
- when there is ethernet, use ethernet (I have an extra profile there, too)
- when there is both, use one of them (or both, or whatever.. just work)
- when interface
usb0
orusb1
occur, only enable dhcp on them when someone issuesdhcpcd <interface>
My current dhcpcd.conf
looks like
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
#clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
duid
# Persist interface configuration when dhcpcd exits.
persistent
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
interface eth0
arping 192.168.1.77
profile 192.168.1.77
static ip_address=192.168.1.65
static routers=192.168.1.77
static domain_name_servers=192.168.1.77
interface usb0
nogateway
interface usb1
nogateway
The wifi/ethernet part seems to work, though I haven't tested it thoroughly. But I don't know, how to set up my usb interfaces to only respond to DHCP on command. The nogateway
is just there to prevent usb interfaces to screw up my default routes ATM.
How do I need to configure dhcpcd
?
Edit 1:
I am on a Gentoo system with no more network configuration except my wpa_supplicant.conf
network-interface dhcp
network-interface dhcp
edited Dec 12 '16 at 14:02
Uroc327
asked Dec 11 '16 at 23:05
Uroc327Uroc327
16529
16529
bumped to the homepage by Community♦ 13 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 13 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
If you are running a Debian based distro just look at the last lines of /etc/default/isc-dhcp-server
:
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth1"
I am on a Gentoo system. How does debian startdhcpcd
whenINTERFACES
is specified?
– Uroc327
Dec 12 '16 at 14:03
man dhcpd
. Simply add a trailingeth0
or any other device as parameter.
– Ipor Sircer
Dec 12 '16 at 14:11
Well, I don't startdhcpcd
manually but I use gentoos rc scripts/runlevels instead.
– Uroc327
Dec 12 '16 at 14:12
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f329690%2fstart-dhcpcd-on-specific-interfaces-only-explicitly%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you are running a Debian based distro just look at the last lines of /etc/default/isc-dhcp-server
:
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth1"
I am on a Gentoo system. How does debian startdhcpcd
whenINTERFACES
is specified?
– Uroc327
Dec 12 '16 at 14:03
man dhcpd
. Simply add a trailingeth0
or any other device as parameter.
– Ipor Sircer
Dec 12 '16 at 14:11
Well, I don't startdhcpcd
manually but I use gentoos rc scripts/runlevels instead.
– Uroc327
Dec 12 '16 at 14:12
add a comment |
If you are running a Debian based distro just look at the last lines of /etc/default/isc-dhcp-server
:
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth1"
I am on a Gentoo system. How does debian startdhcpcd
whenINTERFACES
is specified?
– Uroc327
Dec 12 '16 at 14:03
man dhcpd
. Simply add a trailingeth0
or any other device as parameter.
– Ipor Sircer
Dec 12 '16 at 14:11
Well, I don't startdhcpcd
manually but I use gentoos rc scripts/runlevels instead.
– Uroc327
Dec 12 '16 at 14:12
add a comment |
If you are running a Debian based distro just look at the last lines of /etc/default/isc-dhcp-server
:
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth1"
If you are running a Debian based distro just look at the last lines of /etc/default/isc-dhcp-server
:
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth1"
answered Dec 11 '16 at 23:11
Ipor SircerIpor Sircer
10.8k11124
10.8k11124
I am on a Gentoo system. How does debian startdhcpcd
whenINTERFACES
is specified?
– Uroc327
Dec 12 '16 at 14:03
man dhcpd
. Simply add a trailingeth0
or any other device as parameter.
– Ipor Sircer
Dec 12 '16 at 14:11
Well, I don't startdhcpcd
manually but I use gentoos rc scripts/runlevels instead.
– Uroc327
Dec 12 '16 at 14:12
add a comment |
I am on a Gentoo system. How does debian startdhcpcd
whenINTERFACES
is specified?
– Uroc327
Dec 12 '16 at 14:03
man dhcpd
. Simply add a trailingeth0
or any other device as parameter.
– Ipor Sircer
Dec 12 '16 at 14:11
Well, I don't startdhcpcd
manually but I use gentoos rc scripts/runlevels instead.
– Uroc327
Dec 12 '16 at 14:12
I am on a Gentoo system. How does debian start
dhcpcd
when INTERFACES
is specified?– Uroc327
Dec 12 '16 at 14:03
I am on a Gentoo system. How does debian start
dhcpcd
when INTERFACES
is specified?– Uroc327
Dec 12 '16 at 14:03
man dhcpd
. Simply add a trailing eth0
or any other device as parameter.– Ipor Sircer
Dec 12 '16 at 14:11
man dhcpd
. Simply add a trailing eth0
or any other device as parameter.– Ipor Sircer
Dec 12 '16 at 14:11
Well, I don't start
dhcpcd
manually but I use gentoos rc scripts/runlevels instead.– Uroc327
Dec 12 '16 at 14:12
Well, I don't start
dhcpcd
manually but I use gentoos rc scripts/runlevels instead.– Uroc327
Dec 12 '16 at 14:12
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f329690%2fstart-dhcpcd-on-specific-interfaces-only-explicitly%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown