openSUSE / wicked

Framework for network configuration
https://en.opensuse.org/Portal:Wicked
GNU General Public License v2.0
101 stars 50 forks source link

wicked ipv6 question #750

Closed swood closed 6 years ago

swood commented 6 years ago

Hello.

I have a very strange problem with ipv6. I have an IPv6 DHCP server and I can to ping him from my client via link-local address. But I can't receive an address from this server by command below:

# /usr/lib/wicked/bin/wickedd-dhcp6 --debug ipv6 --log-level debug --test eth0 Info: Interface vethbadc608 references unknown lower device (ifindex 78) Notice: eth0: Request to acquire DHCPv6 lease with UUID 3021085b-18b7-0700-7848-000001000000 in mode auto

Probably I didn't enable something in my sysctl or configs. Maybe someone knows?

mtomaschewski commented 6 years ago

Fix the IPv6 router on this network to send out an router advertisement (RA) which enables DHCPv6 managed mode (needed to get an address) or specify the request mode manually using: wicked test dhcp6 -m managed eth0 You may also use DHCLIENT6_MODE=managed in ifcfg-eth0 (to override RA), but note, that the IPv6 router advertisement is also used to create the (default) routing for IPv6 (not handled by DHCPv6 at all, unlike in DHCPv4).

swood commented 5 years ago

Hey, @mtomaschewski. Sorry, I come back to my question. Now, about the configuration via /etc/sysconfig/network/ifcfg-file. I have a DHCPv6-server based on kea. This server successfully generates a lease with v6-address. And I could check it by the command that you provide me before. But. How to configure it via system-unit like wicked-dhcp4?

I wrote to my configuration file next options:

DHCLIENT6_MODE='managed' IPV6INIT='yes' IPV6_AUTOCONF='yes'

And after I turned systemctl restart network I expecting to see an ipv6 address on my interface. But nothing happened. What's wrong with wicked?

rtorrero commented 5 years ago

@swood : take a look at man 5 ifcfg. specifically STARTMODE and BOOTPROTO, those control at what point the interface is brought up and what configuration protocol is used (static, dhcp4, dhcp6, ...)

(Your ifcfg configuration file is missing those)

swood commented 5 years ago

@rtorrero sorry. You can find my config below:

STARTMODE=auto MACVLAN_DEVICE='eth0' IPADDR='192.168.1.2/24' MACVLAN_MODE="bridge" DHCLIENT6_MODE='managed' IPV6INIT='yes' IPV6_AUTOCONF='yes' POST_UP_SCRIPT="compat:suse:/etc/sysconfig/network/macvlan0-routes-up.sh" POST_DOWN_SCRIPT="compat:suse:/etc/sysconfig/network/macvlan0-routes-down.sh"

And yes, I read this man but it didn't help me.

rtorrero commented 5 years ago

@swood: I'm still missing the BOOTPROTO=dhcp6 part in your ifcfg- file, you would have to add that for wicked to use the DHCPv6 supplicant. Also there are a few options there that I don't know, but that shouldn't cause any harm.

swood commented 5 years ago

@rtorrero I tried and I lost server after that. I read a man and found the interesting option:

         dhcp4 dhcp6 dhcp

A DHCPv4, DHCPv6 or both clients are started to configure the interface. The setup is considered successful, when at least one dhcp client configures the interface. Additionally to the dhcp client configuration, fixed addresses and routes may also be specified. Note: Static routes take precedence over routes provides by dhcp or other leases, that is, a DHCPv4 route with same met- rics as a static one will be skipped. DHCPv6 does not support routing options, an IPv6 Router Advertisement (RA) is applying them.

So, if I'm right that the configuration file has to look like below:

STARTMODE='dhcp4 dhcp6 dhcp' MACVLAN_DEVICE='eth0' IPADDR='192.168.1.2/24' MACVLAN_MODE="bridge" DHCLIENT6_MODE='managed' IPV6INIT='yes' IPV6_AUTOCONF='yes' POST_UP_SCRIPT="compat:suse:/etc/sysconfig/network/macvlan0-routes-up.sh" POST_DOWN_SCRIPT="compat:suse:/etc/sysconfig/network/macvlan0-routes-down.sh"

I've checked it and I saw the same result as 'BOOTPROTO=dhcp6'. So, maybe my version of the Wicked is too old: 0.6.40?

rtorrero commented 5 years ago

You should choose one of the three, either "dhcp4" just for DHCPv4, "dhcp6" for DHCPv6, and "dhcp" to use both DHCPv4 and DHCPv6.

In any case, it is advisable to upgrade to a more recent wicked version for DHCPv6 as last versions have seen some improvements in this part.

13werwolf13 commented 3 years ago

You should choose one of the three, either "dhcp4" just for DHCPv4, "dhcp6" for DHCPv6, and "dhcp" to use both DHCPv4 and DHCPv6.

I correctly understood that I simultaneously understood that the dhcp4 and dhcp6 will not work at the same time? I wanted to get ipv4 and ipv6 to the bridge at the same time, but only 4 works.

BOOTPROTO='dhcp'
STARTMODE='auto'
BRIDGE='yes'
BRIDGE_PORTS='enp67s0f0 eno1 enp68s0f1 enp67s0f1 eno2 enp68s0f0'
BRIDGE_STP='on'
BRIDGE_FORWARDDELAY='15'

while other devices (both virtual and physical) that go through this bridge perfectly receive ipv6. but not himself