GGYU

Netwok - 재택근무 환경 구축 본문

I.F./linux

Netwok - 재택근무 환경 구축

GANADARA 2021. 1. 18. 22:47

nebula를 이용한 재택근무 환경 구축

  1. Generate certificates with subnet for 1 node in my office:
    nebula-cert sign -name "office" -ip "192.168.100.100/24" -subnets "192.168.8.0/24"
  1. Enable unsafe route on my laptop:
    unsafe_routes:
    - route: 192.168.8.0/24 via: 192.168.100.100
  1. Make sure ip forward was enabled on "office", return "1" means enabled:
    For Linux : sysctl -n net.ipv4.ip_forward
    For Windows : Set-NetIPInterface -Forwarding Enabled
  1. Create NAT on "office"
    # create NAT between 192.168.100.0/24 <---> 192.168.8.0/24
    iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -d 192.168.8.0/24 -j MASQUERADE
    # accept all packets from 192.168.100.0/24 to 192.168.8.0/24
    iptables -I FORWARD 1 -s 192.168.100.0/24 -d 192.168.8.0/24 -j ACCEPT
    # accept all established network connections
    iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
Comments