Nebula
Overlay VPN by Slack
An open-source overlay VPN developed by Slack. A lightweight mesh network similar to WireGuard that provides X.509 certificate-based authentication.
Overlay VPN by Slack
An open-source overlay VPN developed by Slack. A lightweight mesh network similar to WireGuard that provides X.509 certificate-based authentication.
Nebula is an open-source overlay network VPN developed by Slack to secure its distributed infrastructure. It was released as open source in 2019, and is characterized by securely connecting thousands of nodes while operating without a central server. It is written in Go and supports multiple platforms.
The core of Nebula is X.509 certificate-based authentication. Each host joins the network with a unique certificate issued to it, and this certificate includes the host's IP address, group memberships, and validity period. No central authentication server is needed, and the certificate itself serves as the basis of trust.
Like WireGuard, it creates encrypted tunnels based on the Noise protocol, but Nebula automatically builds a peer-to-peer (P2P) mesh network. A special node called a Lighthouse tells other nodes where their peers are located and supports NAT traversal (hole punching), so hosts behind firewalls can also communicate directly.
Nebula addresses the drawbacks of existing VPN solutions. Unlike OpenVPN or IPSec, it does not pass through a central gateway, so there is no bottleneck, configuration is simple, and it can scale to tens of thousands of nodes. It is well suited to hybrid infrastructure that connects cloud, on-premises, and edge environments into a single network.
# 1. Nebula 바이너리 다운로드
wget https://github.com/slackhq/nebula/releases/download/v1.9.0/nebula-linux-amd64.tar.gz
tar -xzf nebula-linux-amd64.tar.gz
sudo mv nebula nebula-cert /usr/local/bin/
# 2. CA(인증 기관) 키 쌍 생성 - 최초 1회
nebula-cert ca -name "MyOrg Nebula CA" -duration 8760h
# 결과: ca.crt (공개), ca.key (비밀 - 안전하게 보관!)
# 3. Lighthouse 노드용 인증서 생성
nebula-cert sign -name "lighthouse1" \
-ip "10.100.0.1/24" \
-groups "lighthouse,servers"
# 4. 일반 노드용 인증서 생성
nebula-cert sign -name "server-web-01" \
-ip "10.100.0.10/24" \
-groups "servers,web"
nebula-cert sign -name "laptop-alice" \
-ip "10.100.0.100/24" \
-groups "employees,engineering"
# 5. 인증서 정보 확인
nebula-cert print -path server-web-01.crt
# Name: server-web-01
# IP: 10.100.0.10/24
# Groups: ["servers", "web"]
# Valid: 2024-01-01 ~ 2025-01-01
# 6. 인증서 갱신 (만료 전)
nebula-cert sign -name "server-web-01" \
-ip "10.100.0.10/24" \
-groups "servers,web" \
-duration 8760h # 1년
# config.yaml - Nebula 설정 파일
pki:
ca: /etc/nebula/ca.crt
cert: /etc/nebula/host.crt
key: /etc/nebula/host.key
# Lighthouse 서버 목록 (공인 IP 필요)
static_host_map:
"10.100.0.1": ["lighthouse.example.com:4242"]
lighthouse:
am_lighthouse: false # Lighthouse 노드면 true
interval: 60
hosts:
- "10.100.0.1"
# 네트워크 인터페이스 설정
tun:
disabled: false
dev: nebula1
drop_local_broadcast: false
drop_multicast: false
tx_queue: 500
mtu: 1300
# UDP 리스닝 포트
listen:
host: 0.0.0.0
port: 4242
# NAT 통과 설정
punchy:
punch: true
respond: true
delay: 1s
# 방화벽 규칙 (그룹 기반 접근 제어)
firewall:
outbound:
- port: any
proto: any
host: any
inbound:
# 같은 그룹 내 모든 통신 허용
- port: any
proto: any
group: servers
# engineering 그룹만 SSH 허용
- port: 22
proto: tcp
group: engineering
# 모든 호스트에서 ICMP 허용
- port: any
proto: icmp
host: any
# 로깅 설정
logging:
level: info
format: text
# Nebula 실행 (포그라운드)
sudo nebula -config /etc/nebula/config.yaml
# systemd 서비스로 등록
sudo tee /etc/systemd/system/nebula.service <<EOF
[Unit]
Description=Nebula Overlay Network
Wants=basic.target network-online.target
After=basic.target network-online.target
Before=sshd.service
[Service]
Type=simple
ExecStart=/usr/local/bin/nebula -config /etc/nebula/config.yaml
ExecReload=/bin/kill -HUP \$MAINPID
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
# 서비스 시작
sudo systemctl daemon-reload
sudo systemctl enable nebula
sudo systemctl start nebula
# 상태 확인
sudo systemctl status nebula
journalctl -u nebula -f
# 연결된 피어 확인 (디버그 모드)
sudo nebula -config /etc/nebula/config.yaml -test
# 네트워크 인터페이스 확인
ip addr show nebula1
# 10.100.0.10/24 할당 확인
# 다른 Nebula 노드로 ping
ping 10.100.0.1 # Lighthouse
ping 10.100.0.100 # 다른 호스트
# 방화벽에서 UDP 4242 허용 (필수)
sudo ufw allow 4242/udp
# 또는 iptables
sudo iptables -A INPUT -p udp --dport 4242 -j ACCEPT
"WireGuard is good too, but once you go past 100 nodes, managing the configuration gets hard. Nebula is certificate-based, so each node automatically finds its peers and connects via P2P. You only need to put the Lighthouse on a public IP, and the rest can stay behind NAT."
"Nebula's strength is group-based access control. If you specify groups when issuing certificates, you can apply policies in the firewall rules such as 'only the engineering group is allowed SSH to the servers.' It's effectively RBAC at the network level."
"To explain the differences between Nebula and WireGuard: WireGuard is faster because it runs as a kernel module, while Nebula runs in userspace but is strong in automatic peer discovery and certificate-based authentication. Nebula is suitable for large-scale distributed environments, and WireGuard for small-scale, high-performance VPNs."
Take a mock interview on this topic → WIA SOOM AI Interview · Start for free
If ca.key is leaked, an attacker can issue arbitrary certificates. Store the CA key in an air-gapped environment or an HSM, and use it only when issuing certificates.
When a certificate expires, the node is immediately blocked from the network. Set up an automatic renewal script 30 days before expiration, and configure monitoring alerts.
If the Lighthouse goes down, new peer connections are impossible. Deploy at least 2 Lighthouses in different regions, and register all of them in static_host_map.
Make Lighthouses redundant with at least 2. Set the certificate validity period to 1 year or less and set up automatic renewal. Apply the principle of least privilege in firewall rules. Open only UDP port 4242 and control everything else with the Nebula firewall.