Hats Network | LogoHats Network
Peering

Peering via Layer 3 Tunnel

Configure Layer 3 tunnel peering with AS203314 using WireGuard, GRE, or SIT/ip6gre protocols. Encrypted BGP sessions over WireGuard with no physical presence required at any of our 16+ PoPs.

A Layer 3 tunnel carries IP packets between endpoints without extending an Ethernet broadcast domain. It is the usual choice for routed peering; encapsulation and encryption determine its overhead.

Layer 3 Tunnel Overview

Replace the placeholder addresses, interface names and keys with the agreed configuration before applying these examples.

  • {name} - Tunnel interface name
  • {yourside ip} - Your public IP address
  • {ourside ip} - Our endpoint IP address
  • {yourside port} - Your source port (WireGuard)
  • {ourside port} - Our destination port (WireGuard)
  • {your tunnel ip cidr} - Your tunnel IP/subnet
  • {our public key} - Our WireGuard public key
  • {your private key} - Your WireGuard private key

Tunnel Profile Selection

Layer 3 Tunnel ProfilesChoose protocol matching your security, compatibility, and address-family needs.WireGuardEncrypted, lightweight, preferred for secure peeringGREMinimal-overhead IPv4/dual-stack over IPv4SIT / IPv6 GRE tunnelIPv6 carriage over IPv4 underlay

WireGuard

WireGuard is a modern, lightweight VPN protocol that provides encrypted Layer 3 tunneling. It's our recommended choice for secure peering due to its simplicity and performance.

For a wg-quick deployment, use the following WireGuard configuration:

/etc/wireguard/{name}.conf
[Interface]
Address    = {your tunnel ip cidr}
ListenPort = {yourside port}
PrivateKey = {your private key}
# Disable WireGuard's built-in routing table management when using
# an external routing daemon (e.g. BIRD, FRR)
Table = off

[Peer]
PublicKey           = {our public key}
AllowedIPs          = 0.0.0.0/0, ::/0
Endpoint            = {ourside ip}:{ourside port}
PersistentKeepalive = 25

GRE Tunnel

GRE (Generic Routing Encapsulation) operates at Layer 3 and is suitable for routing IPv4/IPv6 traffic over an IPv4 underlay. It's simple, widely-supported, and has minimal overhead.

ip tunnel add {name} mode gre local {yourside ip} remote {ourside ip} ttl 255
ip addr add {your tunnel ip cidr} dev {name}
ip link set dev {name} up

SIT / ip6gre (IPv6 Tunneling)

SIT (Simple Internet Transition) tunnels IPv6 traffic over an IPv4 underlay and is commonly used for 6in4 connectivity.

ip6gre provides full GRE encapsulation for IPv6 and is preferred when you need GRE key support or multi-protocol capability.

# SIT: IPv6-in-IPv4
ip tunnel add {name} mode sit local {yourside ipv4} remote {ourside ipv4} ttl 255
ip addr add {your tunnel ipv6 cidr} dev {name}
ip link set dev {name} up

Protocol Comparison

ProtocolEncryptionIPv4IPv6OverheadNAT Traversal
WireGuardYes✓✓32 bytesGood (UDP)
GRENo✓✓28 bytesLimited
SITNoN/A✓20 bytesLimited
ip6greNoN/A✓28 bytesLimited

Protocol Selection Guide

  • WireGuard: Best for secure peering, supports both IPv4 and IPv6
  • GRE: Simple, widely-supported, good for IPv4 peering
  • SIT/ip6gre: Use when you only need IPv6 transport over IPv4

MTU Considerations

Encapsulation consumes part of the underlay MTU. Set the tunnel MTU to leave room for the chosen protocol's headers.

ProtocolOverheadRecommended MTU
WireGuard32 bytes1468
GRE28 bytes1472
SIT20 bytes1480
ip6gre28 bytes1472

WireGuard MTU example:

ip link set dev {name} mtu 1468

Next Steps

After configuring both endpoints, verify the following:

  1. Verify connectivity using ping or traceroute
  2. Configure your BGP daemon (BIRD, FRR, etc.) to use the tunnel interface
  3. Contact us to finalize the peering session

Once tunnel reachability is confirmed, contact the peering team to complete the AS203314 BGP session.

On this page