dhcpcd-discuss

Re: setting virtual interface in container

msg board

Tue Nov 10 23:16:13 2020

Thank you. Adding --nodev works. but why was it needed and what did it do
that it worked now - if you can please explain.

On Tue, Nov 10, 2020 at 2:38 PM Roy Marples <roy@xxxxxxxxxxxx> wrote:

> Does adding --nodev to the command line make it work?
>
>
> Roy
>
> Sent from Nine <http://www.9folders.com/>
> ------------------------------
> *From:* msg board <msgboardpana@xxxxxxxxx>
> *Sent:* Tuesday, 10 November 2020 22:30
> *To:* dhcpcd-discuss@xxxxxxxxxxxx
> *Subject:* Re: setting virtual interface in container
>
> Thanks Roy.
>
> I started dhcpcd with this commandline  "dhcpcd -w -f /etc/dhcpcd.conf"
>   and added below lines in dhcpcd.conf
>
> debug
> logfile /var/log/dhcpcd.log
>
> Here is contents of dhcpcd.log
>
> Nov 10 22:27:48 [414]: dhcpcd-8.1.6 starting
> Nov 10 22:27:48 [414]: udev: starting
> Nov 10 22:27:48 [414]: dev: loaded udev
> Nov 10 22:27:48 [414]: no valid interfaces found
> Nov 10 22:28:18 [414]: timed out
> Nov 10 22:28:18 [414]: forking to background
> Nov 10 22:28:18 [414]: forked to background, child pid 417
>
> On Tue, Nov 10, 2020 at 12:47 AM Roy Marples <roy@xxxxxxxxxxxx> wrote:
>
>> On 10/11/2020 02:04, msg board wrote:
>> > I have a virtual interface vlan190 on my lxc container. When my
>> container boots,
>> > this interface only get ipv6 address. The dhcpcd daemon is start by
>> init
>> > environment using command dhcpcd . The expectation is that it will
>> reach
>> > /etc/dhcpcd.conf file which is where I specify the interface to
>> configure. Here
>> > is my dhcpcd.conf file (do read last few lines) . In Spite of this, I
>> do not get
>> > IPv4 IP on my vlan190 .
>> >
>> > When I run "dhcpcd --waitip 4 vlan190 on command line, I get IPv4 IP
>> > immediately. However I cannot specify vlan190 on my init scripts for
>> dhcpcd. It
>> > has to go inside dhcpcd.conf. Is that a way to specify virtual
>> interface in
>> > dhcpcd.conf.
>> >
>> > # A sample configuration for dhcpcd.
>> > # 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
>> > # Respect the network MTU. This is applied to DHCP routes.
>> > option interface_mtu
>> >
>> > # Most distributions have NTP support.
>> > #option ntp_servers
>> >
>> > # A ServerID is required by RFC2131.
>> > require dhcp_server_identifier
>> >
>> > # Generate SLAAC address using the Hardware Address of the interface
>> > #slaac hwaddr
>> > # OR generate Stable Private IPv6 Addresses based from the DUID
>> > slaac private
>> >
>> > interface vlan190
>> > waitip 4
>>
>> Your configuration looks fine and should work.
>> But this all depends how exactly your init script starts dhcpcd.
>> If you add this to /etc/dhcpcd.conf at the top
>>
>> debug
>> logfile /var/log/dhcpcd.log
>>
>> Then hopefully the logfile will give a clue as to why it's not working.
>>
>> Roy
>>
>

Follow-Ups:
Re: setting virtual interface in containerRoy Marples
References:
Re: setting virtual interface in containermsg board
Re: setting virtual interface in containerRoy Marples
Archive administrator: postmaster@marples.name