Skip to content

Instantly share code, notes, and snippets.

@bearice
Created January 29, 2015 08:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bearice/1cbd09ab01f9bc4d3c8b to your computer and use it in GitHub Desktop.
Save bearice/1cbd09ab01f9bc4d3c8b to your computer and use it in GitHub Desktop.
公网机器:
ip tunnel add tunnel0 remote {对方内网地址} local {本机内网地址} mode ipip
ifconfig tunnel0 192.168.123.1/24
ifconfig tunnel0 up
iptables -t nat -A POSTROUTING -s 192.168.123.0/24 -j MASQUERADE
内网机器:
ip tunnel add tunnel0 remote {对方内网地址} local {本机内网地址} mode ipip
ifconfig tunnel0 192.168.123.2/24
ifconfig tunnel0 up
route add default dev tunnel0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment