All of lore.kernel.org
 help / color / mirror / Atom feed
* slirp: Can I get IPv6-only DHCP working?
@ 2022-08-25 22:38 Peter Delevoryas
  2022-08-25 22:56 ` Samuel Thibault
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Delevoryas @ 2022-08-25 22:38 UTC (permalink / raw)
  Cc: qemu-arm, qemu-devel, clg, samuel.thibault, garnermic, patrick, zhdaniel

I'm having a hard time figuring this out from looking at the code and the
user-level help options.

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. Maybe there's no support
then? I'm interested in adding it, if that's the case.

Thanks,
Peter


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: slirp: Can I get IPv6-only DHCP working?
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Samuel Thibault @ 2022-08-25 22:56 UTC (permalink / raw)
  To: Peter Delevoryas; +Cc: qemu-arm, qemu-devel, clg, garnermic, patrick, zhdaniel

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;
    }

Samuel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: slirp: Can I get IPv6-only DHCP working?
  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
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Delevoryas @ 2022-08-25 23:15 UTC (permalink / raw)
  To: Samuel Thibault; +Cc: qemu-arm, qemu-devel, clg, garnermic, patrick, zhdaniel

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. But, since the
DHCPv6 hook "dhcpv6_input" is already there, maybe I can just get something
going through there? I suppose I might need some IPv6 NDP packets to work too,
to ssh through a hostfwd port.

    root@bmc-oob:~# ifconfig eth0
    eth0      Link encap:Ethernet  HWaddr FA:CE:B0:02:20:22
              inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
              inet6 addr: fec0::f8ce:b0ff:fe02:2022/64 Scope:Site
              inet6 addr: fe80::f8ce:b0ff:fe02:2022/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:107 errors:0 dropped:0 overruns:0 frame:0
              TX packets:136 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:13316 (13.0 KiB)  TX bytes:10022 (9.7 KiB)
              Interrupt:33

Anyways, I'll do some more investigation on my own, thanks!
Peter

> 
> Samuel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: slirp: Can I get IPv6-only DHCP working?
  2022-08-25 23:15   ` Peter Delevoryas
@ 2022-08-25 23:20     ` Samuel Thibault
  2022-08-26  7:21     ` Thomas Huth
  1 sibling, 0 replies; 5+ messages in thread
From: Samuel Thibault @ 2022-08-25 23:20 UTC (permalink / raw)
  To: Peter Delevoryas; +Cc: qemu-arm, qemu-devel, clg, garnermic, patrick, zhdaniel

Peter Delevoryas, le jeu. 25 août 2022 16:15:26 -0700, a ecrit:
> On Fri, Aug 26, 2022 at 12:56:10AM +0200, Samuel Thibault wrote:
> > 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.

Ah. It doesn't seem to indeed.

> since the DHCPv6 hook "dhcpv6_input" is already there, maybe I can
> just get something going through there?

Probably.

Samuel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: slirp: Can I get IPv6-only DHCP working?
  2022-08-25 23:15   ` Peter Delevoryas
  2022-08-25 23:20     ` Samuel Thibault
@ 2022-08-26  7:21     ` Thomas Huth
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2022-08-26  7:21 UTC (permalink / raw)
  To: qemu-devel

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-26  7:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.