Giter Club home page Giter Club logo

Comments (6)

Sunr0 avatar Sunr0 commented on June 4, 2024 1

Congratulations, I have successfully implemented it according to what you said. It is a great tool.

I hope that we can specify the listening port of the server through parameters.

However, the client should not be able to work normally without a public IP. haha

from wiretap.

luker983 avatar luker983 commented on June 4, 2024

Currently he handshake has to be initiated from the client when doing nested hops. This means you can't use the --endpoint argument when running ./wiretap configure on the client or ./wiretap serve on hop 2.

Instead, when you run the second ./wiretap configure for hop 2 from your client, you take the resulting config file and add the Endpoint Line to the peer section:

# wiretap_1.conf
[Interface]
PrivateKey = <private key>
Address = 192.168.0.2/32
Address = fd::2/128
ListenPort = 51821

[Peer]
PublicKey = <public key>
AllowedIPs = <routes exposed by second hop>
### Manually add this line:
Endpoint = <ip of hop 2>:<port>
###

Then you can bring up the second tunnel with wg-quick up./wiretap_1.conf or whatever WireGuard client you're using. This causes your WireGuard interface to initiate the handshake through the first hop.

Happy to clarify more if needed!

from wiretap.

Sunr0 avatar Sunr0 commented on June 4, 2024

I generated the corresponding configuration file as you said, and added the Endpoint field.

I first execute wg-quick up ./wiretap.conf and everything works fine, execute wg-quick up ./wiretap_1.conf but report an error RTNETLINK answers: File exists.

wiretap is from client to hop1, and wiretap_1 is generated using wiretap configure --port 51821 --routes <routes exposed by second hop>.

Is there something wrong with my operation.

from wiretap.

Sunr0 avatar Sunr0 commented on June 4, 2024

wiretap.conf

[Interface]
PrivateKey =<private key1>
Address = 192.168.0.2/32
Address = fd::2/128
ListenPort = 1080

[Peer]
PublicKey = <public key1>
AllowedIPs = <routes exposed by second hop>

wiretap_1.conf

[Interface]
PrivateKey = <private key2>
Address = 192.168.0.2/32
Address = fd::2/128
ListenPort = 1081

[Peer]
PublicKey = <public key2>
AllowedIPs = <routes exposed by second hop>
Endpoint = <ip of hop 2>:<port>

from wiretap.

luker983 avatar luker983 commented on June 4, 2024

Looks like you're almost there. That error is likely because the routes in your two configuration files overlap. Make sure wiretap.conf only has the routes exposed by the first hop and wiretap_1.conf has routes exposed by the second hop.

If you don't include the -d option to wiretap configure, an API address will also be included. I bet you just need to remove a::/128 from the AllowedIPs of wiretap_1.conf

from wiretap.

luker983 avatar luker983 commented on June 4, 2024

Great! Glad it worked. I plan to add better support for nested/multi-hop tunnels in the near future.

from wiretap.

Related Issues (10)

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.