Skip to content

Implement split tunneling capabilities #36

@parfenovvs

Description

@parfenovvs

Summary

Add split tunneling functionality to allow selective routing of traffic through VPN or direct connection based on application, domain, or IP address rules.

Features

Traffic Routing Options

  • Application-based routing (route specific apps through VPN)
  • Domain-based routing (route specific domains direct/VPN)
  • IP-based routing (custom IP ranges)
  • Process-based routing (PID-based rules)

Configuration Interface

# Configure split tunneling rules
mbvpn split-tunnel add-app firefox
mbvpn split-tunnel add-domain github.com --direct
mbvpn split-tunnel add-ip 192.168.1.0/24 --direct

# List current rules
mbvpn split-tunnel list

# Connect with split tunneling
mbvpn connect us-east-01 --split-tunnel

Configuration File

# In ~/.config/mbvpn/config.yml
split_tunnel:
  enabled: true
  default_route: vpn  # vpn or direct
  rules:
    applications:
      - name: "firefox"
        route: "vpn"
      - name: "steam"  
        route: "direct"
    domains:
      - pattern: "*.local"
        route: "direct"
      - pattern: "github.com"
        route: "direct"
    ip_ranges:
      - cidr: "192.168.0.0/16"
        route: "direct"
      - cidr: "10.0.0.0/8"
        route: "direct"

Implementation Approaches

Linux-specific Implementation

  1. iptables + routing tables
  2. netfilter/netlink integration
  3. cgroup-based application routing

Technical Challenges

  • Process identification and tracking
  • Dynamic rule application
  • IPv6 support
  • Performance optimization

Use Cases

  • Keep local network traffic direct
  • Route work applications through VPN only
  • Exclude gaming traffic for better latency
  • Compliance with geo-restrictions

Priority

🚀 Priority 2 (2-3 weeks)

Labels

  • enhancement
  • priority-2
  • networking
  • advanced-feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions