weaveworks / ignite

Ignite a Firecracker microVM
https://ignite.readthedocs.org
Apache License 2.0
3.49k stars 222 forks source link

440 support dhcp 6 - DO NOT MERGE #963

Open RichardoC opened 1 year ago

RichardoC commented 1 year ago

Pushing up in case anyone else with more IPv6 experience wants to push this forward for #440

It borrows heavily from https://github.com/RedTeamPentesting/pretender

Currently this code correctly receives the IPv6 DHCP requests, but doesn't seem to be responding (or is responding in a way the client isn't happy with)

In order to test this out, run the following commands from the root of the repo on this branch/change.

# Terminal 1
# Build this code
make build-all-amd64

# Run an ubuntu machine, and leave it foregrounded with debug logs
sudo ./bin/ignite --log-level debug run weaveworks/ignite-ubuntu   --name v6test   --cpus 2   --memory 1GB   --size 6GB   --ssh   --interactive

# Terminal 2
# SSH into that machine
sudo ./bin/ignite ssh v6test
# The following commsudo ./bin/ignite ssh v6testands are running inside the v6test ubuntu machine

apt update

apt install -y isc-dhcp-client

# Request a DHCPv6 address
dhclient -6 eth0 

# In terminal 1 you'll see plenty of messages like the following which suggests it's getting into the handleSolicit function
DEBU[0051] SOLICIT SOMEV6ADDRESS
DEBU[0051] Message(messageType=ADVERTISE transactionID=0x9c231e, 4 options) 
DEBU[0051] SOMEV6ADDRESS

To tidy up


sudo ./bin/ignite rm -f v6test
RichardoC commented 1 year ago

After a look, it's entirely possible that the network it's trying to do DHCP on is ipv4, but I'm not sure where that's configured