# Configure Hetzner Floating Ip

> Configure a Hetzner Cloud Floating IP persistently on Ubuntu servers using Netplan. Ensures the floating IP survives reboots and is externally accessible.

- **Type:** Skill
- **Install:** `agentstack add skill-zheli-agent-skills-configure-hetzner-floating-ip`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [zheli](https://agentstack.voostack.com/s/zheli)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [zheli](https://github.com/zheli)
- **Source:** https://github.com/zheli/agent-skills/tree/main/.claude/skills/configure-hetzner-floating-ip

## Install

```sh
agentstack add skill-zheli-agent-skills-configure-hetzner-floating-ip
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Configure Hetzner Cloud Floating IP

## Purpose
Configure a Hetzner Cloud Floating IP to be persistently assigned to an Ubuntu server. This skill creates the necessary Netplan configuration to ensure the floating IP remains active after system reboots.

## Prerequisites
- Ubuntu server running 24.04 LTS or newer with Netplan (default on modern Ubuntu)
- SSH access to the server (root or sudo user)
- A Hetzner Cloud Floating IP already created in your project
- Primary network interface is `eth0` (standard for Hetzner Cloud servers)

## When to Use This Skill
Use this skill when you need to:
- Assign a Hetzner Cloud Floating IP permanently to a server
- Configure high-availability setups with failover IPs
- Set up load balancing with floating IPs
- Ensure floating IPs persist across server reboots
- Migrate floating IPs between servers with persistent configuration

## Customization Variables
Before running commands, replace these placeholders:
- ``: The primary IP address of your server (for SSH access)
- ``: The Hetzner Cloud Floating IP to configure (e.g., 5.75.216.246)
- ``: SSH username (e.g., root, ubuntu)
- `eth0`: Replace with different interface name if needed (verify with `ip link show`)

## Steps

### 1. Verify Server Uses Netplan
```bash
# Check if netplan directory exists
ssh @ 'ls -la /etc/netplan/'

# Check Ubuntu version (24.04+ uses netplan by default)
ssh @ 'lsb_release -a'
```

Expected: You should see netplan configuration files (*.yaml) in `/etc/netplan/`

### 2. Create Floating IP Configuration File
```bash
# Create netplan configuration for floating IP
ssh @ 'sudo tee /etc/netplan/60-floating-ip.yaml > /dev/null /32
EOF'

# Verify file was created correctly
ssh @ 'sudo cat /etc/netplan/60-floating-ip.yaml'
```

### 3. Set Correct File Permissions
```bash
# Netplan requires configuration files to have 600 permissions
ssh @ 'sudo chmod 600 /etc/netplan/60-floating-ip.yaml'

# Verify permissions
ssh @ 'ls -l /etc/netplan/60-floating-ip.yaml'
```

Expected: `-rw------- 1 root root` (600 permissions)

### 4. Apply Netplan Configuration
```bash
# Apply the new configuration
ssh @ 'sudo netplan apply'

# Verify no errors during apply
echo "If no errors above, configuration was applied successfully"
```

### 5. Verify Floating IP is Active
```bash
# Check that floating IP appears on eth0 interface
ssh @ 'ip addr show eth0'

# Verify floating IP is listed (look for /32)
ssh @ 'ip addr show eth0 | grep '
```

Expected: You should see `/32` in the output

### 6. Test External Connectivity
```bash
# Test that the floating IP responds to ping from external source
ping -c 3 

# Verify server can reach external services via floating IP
ssh @ 'curl -s --interface  https://ifconfig.me'
```

Expected: Ping should succeed, and curl should return the floating IP address

## Expected Results
After running all steps, you should have:
- ✓ Netplan configuration file `/etc/netplan/60-floating-ip.yaml` created
- ✓ File permissions set to 600 (required by netplan)
- ✓ Floating IP visible on eth0 interface via `ip addr show`
- ✓ Floating IP responds to external ping
- ✓ Configuration persists across server reboots
- ✓ No conflicts with primary IP address

## Security Notes
- **Root Access**: This skill requires sudo/root access to modify network configuration
- **Network Interruption**: Applying netplan configuration may cause brief network interruption
- **Firewall Rules**: Ensure firewall rules allow traffic to the floating IP
- **IP Conflicts**: Verify the floating IP is not assigned to another server in Hetzner Cloud
- **Backup Configuration**: Keep a backup of working netplan configs before modifications

## Troubleshooting

### Netplan Apply Fails
**Problem**: `sudo netplan apply` returns errors
**Solution**: 
- Check YAML syntax in `/etc/netplan/60-floating-ip.yaml` (indentation must be exact)
- Verify file permissions are 600
- Use `sudo netplan --debug apply` for detailed error messages

### Floating IP Not Appearing on Interface
**Problem**: `ip addr show eth0` doesn't show the floating IP
**Solution**:
- Verify the netplan configuration was applied: `sudo netplan get`
- Check if interface name is correct (might be ens3 instead of eth0)
- Restart networking: `sudo systemctl restart systemd-networkd`

### Floating IP Not Reachable Externally
**Problem**: Cannot ping or connect to floating IP from outside
**Solution**:
- Verify floating IP is assigned to this server in Hetzner Cloud Console
- Check firewall rules: `sudo ufw status` or `sudo iptables -L`
- Ensure the floating IP appears in `ip addr show`
- Verify routing: `ip route show`

### Configuration Doesn't Persist After Reboot
**Problem**: Floating IP disappears after server restart
**Solution**:
- Verify `/etc/netplan/60-floating-ip.yaml` still exists after reboot
- Check file wasn't overwritten by other netplan configs
- Ensure netplan service is enabled: `sudo systemctl status systemd-networkd`

### Permission Denied Errors
**Problem**: Cannot modify netplan configuration files
**Solution**:
- Ensure using sudo for all configuration commands
- Verify user has sudo privileges: `sudo -v`
- Check file ownership: `ls -l /etc/netplan/`

## References
- Hetzner Cloud Floating IP Documentation: https://docs.hetzner.com/cloud/floating-ips/persistent-configuration/
- Ubuntu Netplan Documentation: https://netplan.io/
- Systemd-networkd Documentation: https://www.freedesktop.org/software/systemd/man/systemd.network.html
- Hetzner Cloud Console: https://console.hetzner.cloud/

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [zheli](https://github.com/zheli)
- **Source:** [zheli/agent-skills](https://github.com/zheli/agent-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-zheli-agent-skills-configure-hetzner-floating-ip
- Seller: https://agentstack.voostack.com/s/zheli
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
