Skip to main contentPhantom-WG

Multihop

Multihop routes client traffic through an exit server instead of sending it directly to the internet. The daemon runs two WireGuard interfaces: one serves clients (wg_phantom_main), the other connects to the exit tunnel (wg_phantom_exit). Firewall rules handle the traffic forwarding between them.


Topology

Loading Diagram
Please wait...
Loading...

Traffic Flow

When a packet from a client reaches the daemon, firewall rules take over:

Loading Diagram
Please wait...
Loading...

Firewall Rules

When multihop is enabled, the multihop-exit preset is applied. There are three main rule groups:

Policy Routing

Table 200 (mh) is created. Traffic from the client subnet is directed to this table:

Loading Diagram
Please wait...
Loading...

Forward Rules

Masquerade

Client IPs appear to the exit server as the daemon's tunnel address (SNAT).


Lifecycle

Loading Diagram
Please wait...
Loading...
Safe transition.
To switch to a different exit server, the current connection must be disabled first. This design prevents partial state.