grafcube

joined 4 months ago
[–] [email protected] 1 points 2 weeks ago

It doesn't have to be the same address, just one that I can be sure is associated with a specific peer.

Here's what I see with ip -6 route

2405:201:d03c:d849::/64 dev enp1s0 proto ra metric 100 pref medium
fd42::1 dev wg0 proto kernel metric 256 pref medium
fe80::/64 dev docker0 proto kernel metric 256 pref medium
fe80::/64 dev vethe60384e proto kernel metric 256 pref medium
fe80::/64 dev veth9415685 proto kernel metric 256 pref medium
fe80::/64 dev vetha288603 proto kernel metric 256 pref medium
fe80::/64 dev veth99b7aad proto kernel metric 256 pref medium
fe80::/64 dev vethabf9238 proto kernel metric 256 pref medium
fe80::/64 dev enp1s0 proto kernel metric 1024 pref medium
default via fe80::8ea3:99ff:fe5a:d796 dev enp1s0 proto ra metric 100 pref high

I'm a little confused where the NAT comes in.

I think I misunderstood how NAT works.

 

I have a server with wireguard in a container with host networking. I want to assign an ipv6 subnet for each peer (eg: fd42:413d:a91f:dd37::/64) that the client (my laptop) can freely use all the addresses in that subnet and corresponding port ranges as a separate network interface. Meanwhile on the server, that exact same ip and port is routed to that specific client but through the tunnel.

Here's an example:

  1. Server config

    [Interface]
    Address = fd42::1/128
    ListenPort = 51820
    PrivateKey = <key>
    
    [Peer]
    PublicKey = <key>
    AllowedIPs = fd42:413d:a91f:dd37::/64
    
  2. Client config

    [Interface]
    PrivateKey = <key>
    Address = fd42:413d:a91f:dd37::1/64
    
    [Peer]
    PublicKey = <key>
    Endpoint = server.local:51820
    AllowedIPs = fd42:413d::/32, fd42:413d:a91f:dd37::/64
    
  3. Run a server on the client

    python -m http.server 8080 --bind fd42:413d:a91f:dd37::1 -d dist
    
  4. Access on the server

    curl -svL http://[fd42:413d:a91f:dd37::1]:8080/
    

I can't get step 4 to work. It's also entirely possible that my lack of knowledge in networking is making me think this is even possible in the first place. Any help is appreciated!

[–] [email protected] 2 points 2 months ago

how it is different from the alternative?

I made this because I wanted to be able to change the command used for saving, and also so that I don't need to use any special commands to edit files in the first place. I just open the file I want to edit and if it needs sudo to edit, it prompts me.

does it work in Windows?

No. I don't use Windows so I'm not really interested in getting it to work.

 

I got a drawing tablet a couple of days ago and I really wanted to be able to scroll with it (it only has 4 buttons). I saw that it might be possible on X11 with xsetwacom but I'm on wayland and I couldn't find any way to make it work. So I hacked this together. Idk if anyone would find this useful but I did see a few threads around while looking to solve this exact problem so here you go.

 

I made a small plugin that other people might find handy. It checks if the file open in the current buffer has write access and if not, prompts for sudo (or any other command at your choice) and copies the file.

No longer do you need to care about forgetting to use sudoedit or anything else, just edit the files you want to edit! This could change the world!!1!

But in all seriousness, this is my first neovim plugin and I barely spent an hour on it but it's simple and it gets the job done. It scratches a minor itch and maybe you'll also find it useful.