bottlerocket-os / bottlerocket-os/bottlerocket
No Automatic DHCP on secondary `eth1` interface for `aws-ecs-2` variant
- Dominant language
- Rust
- Stars
- 9.7k
- Forks
- 586
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 12
Description
We are using the BottlerRocket AWS-ECS-2 variant to create a host with two ENIs (on different VPC subnets in order). Bottlerocket fails to detect other ENIs that has been attached. Anyway to solve this?
The problem seems to be with [this line](https://github.com/bottlerocket-os/bottlerocket/blob/c4b17dd1dfe50e5fc3949a6d8e403857a9202a63/variants/aws-ecs-2/Cargo.toml#L32)
I think this is a pretty common use case that could be added.
Related to #3394
**Image I'm using:**
Latest `aws-ecs-2 variant` bottlerocket-v1.20 (`systemd-network`)
**What I expected to happen:**
When an ENI is attached, bottlerocket could use `udev` or alike, to detect the new `eth1` network interface and immediately tell `netdog` or `systemd-network` to enable DHCPv4 and DHCPv6 with `RouteMetric=2048`.
**What actually happened:**
`ip link` in sheltie, shows the `eth1` interface.
However, did not get a DHCP lease.
**How to reproduce the problem:**
Launch a new AWS EC2 instance with bottlerocket-v1.20 `aws-ecs-2` AMI.
Then attach a new secondary ENI to the EC2 instance.
Use AWS SSM session to run these commands:
```bash
# Notice that eth1 does not show up on `ip addr` and `networkctl status`.
ip link
ip addr
networkctl status
# Configure eth1 manually (without netdog)
cat < /etc/systemd/network/11-eth1.network
[Match]
Name=eth1
[Link]
RequiredForOnline=false
RequiredFamilyForOnline=ipv4
[Network]
DHCP=yes
IPv6AcceptRA=true
IPv6DuplicateAddressDetection=0
KeepConfiguration=dhcp
[DHCPv4]
UseMTU=true
RouteMetric=2048
[DHCPv6]
WithoutRA=solicit
[IPv6AcceptRA]
UseMTU=true
RouteMetric=2048
EOF
systemctl reload systemd-networkd
networkctl status
ip route
ip -6 route
```
Contributor guide
Research direction
Start with variants/aws-ecs-2/Cargo.toml at the referenced dependency line, then trace how netdog and systemd-network handle interfaces beyond the primary ENI. Reproduce the issue on an aws-ecs-2 instance by attaching a secondary ENI and inspect ip, networkctl, and the manual network configuration. Done means the secondary interface receives DHCP configuration automatically with the expected route metrics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, linux, rust
- Domain
- cloud, networking, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100