All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: slirp: Can I get IPv6-only DHCP working?
Date: Fri, 26 Aug 2022 09:21:12 +0200	[thread overview]
Message-ID: <c44e41ee-cdf8-a808-b685-fa43306b83f3@redhat.com> (raw)
In-Reply-To: <YwgCjqC90KhDKUnr@pdel-fedora-MJ0HJWH9>

On 26/08/2022 01.15, Peter Delevoryas wrote:
> On Fri, Aug 26, 2022 at 12:56:10AM +0200, Samuel Thibault wrote:
>> Hello,
>>
>> Peter Delevoryas, le jeu. 25 août 2022 15:38:53 -0700, a ecrit:
>>> It seems like there's support for an IPv6 dns proxy, and there's literally a
>>> file called "dhcpv6.c" in slirp, but it has a comment saying it only supports
>>> whatever is necessary for TFTP network boot I guess.
>>
>> For which DNS support is welcome :)
>>
>>> Maybe there's no support then?
>>
>> It seems there is:
>>
>>      if (ri.want_dns) {
>>          *resp++ = OPTION_DNS_SERVERS >> 8; /* option-code high byte */
>>          *resp++ = OPTION_DNS_SERVERS; /* option-code low byte */
>>          *resp++ = 0; /* option-len high byte */
>>          *resp++ = 16; /* option-len low byte */
>>          memcpy(resp, &slirp->vnameserver_addr6, 16);
>>          resp += 16;
>>      }
> 
> Well, that's great, but actually I just care about whether slirp supports DHCPv6
> address requests. Sorry if I didn't explain that properly.
> 
> My goal is to run:
> 
>      qemu-system-arm -machine fby35-bmc -nographic -mtdblock image-bmc \
>          -net nic,model=ftgmac100,netdev=nic \
>          -netdev user,id=nic,hostfwd=::2222-:22
> 
> And then see that the BMC received an IPv6 address assignment.
> 
> But, slirp currently just supports IP address assignment through BOOTP?  I
> didn't realize that until looking a little closer at the code.

No, slirp support "IPv6 *stateless* address assignment" (if you haven't 
heard about that before, I suggest to google it). That means that IPv6 
addresses are not administered by a DHCP server, but that each client can 
built its own IPv6 address. It basically works like this (don't quote me on 
that, it's been a while since I worked with this stuff): Once the network 
interface of the client gets activated, the OS creates a link-local IPv6 
that can be only used for activating on the link (based on the MAC address). 
It then uses this address for sending a "router solicitation" message, and 
if there is a router on the link, it replies with a "router advertisment" 
that contains a routable prefix. The client then can take this prefix to 
form a unique IPv6 address and assign it to its interface. QEMU/slirp 
support this way of address assignment, see ndp_send_na() in ip6_icmp.c.
So if your BMC code supports stateless IPv6 address (it certainly should), 
you should be fine already).

  HTH,
   Thomas



      parent reply	other threads:[~2022-08-26  7:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25 22:38 slirp: Can I get IPv6-only DHCP working? Peter Delevoryas
2022-08-25 22:56 ` Samuel Thibault
2022-08-25 23:15   ` Peter Delevoryas
2022-08-25 23:20     ` Samuel Thibault
2022-08-26  7:21     ` Thomas Huth [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c44e41ee-cdf8-a808-b685-fa43306b83f3@redhat.com \
    --to=thuth@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.