Git Product home page Git Product logo

wireguard-configuration's Introduction

Server side

Requirements:

  • socat
  • nmap
  • iptables/ip6tables
# socat EXEC:./server.sh,pty,rawer TCP-LISTEN:12345,bind=192.168.128.1,fork,reuseaddr
./start-server.sh
# or
sudo ./start-server.sh

Client side

export ENDPOINT=<...>
export REMOTE_HOSTNAME=192.168.128.1
export REMOTE_PORT=12345
./start-client.sh

Alt

Wireguard over Websocket (TODO)

  1. Install websocat
cargo install --features=ssl websocat

If use nginx as websocat proxy, first configure nginx.

Server:

websocat --udp-reuseaddr -E -b --restrict-uri / ws-listen:172.17.0.1:8443 udp:127.0.0.1:8443

Or direct use websocat, generate pkcs12 cert:

openssl pkcs12 -export -out cert.pkcs12 -inkey key.pem -in cert.pem

then

websocat --udp-reuseaddr -E -b --restrict-uri / --pkcs12-der ./cert.pkcs12 --pkcs12-passwd <PASSWORD> ws-listen:172.17.0.1:443 udp:127.0.0.1:8443

Client:

websocat -E --ping-interval 10 --ping-timeout 30 -b udp-listen:127.0.0.1:8443 autoreconnect:wss://<SERVER>

or

websocat -E --ping-interval 10 --ping-timeout 30 --ws-c-uri ws://<WE_ENDPOINT> --tls-domain <WS_DOMAIN> -b udp-listen:127.0.0.1:8443 autoreconnect:ws-c:tls-connect:tcp:<IP>:<PORT>

and configure wireguard endpoint as 127.0.0.1:8443.

NOTE: The websocket server ip must be bypass wireguard.

wireguard-configuration's People

Contributors

zbinlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wireguard-configuration's Issues

你好,ipv6如果不使用nat,可以打标签实现分流吗?

你好,ipv6如果使用公网地址,但是不打标签,可以实现ip6table打标签,ip rule 分流吗?
也就是说240e:xxxx 的ipv6地址,发出包forward到vpn端口,出去到服务器,返回的按正常流量返回,可以实现吗?感觉回程肯定不会vpn,因为源地址没有变。个人ipv6比较讨厌nat,能ndp或者其他实现的都不想做ula到gla的nat6.谢谢大神。

mac如何分流

mac OS不支持 ip rule add to命令,请问如何实现分流

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.