Giter VIP home page Giter VIP logo

Comments (23)

wow0000 avatar wow0000 commented on August 11, 2024

Hello,
I would need more informations than a single screenshot in order to help you. Please respond with details such as: Your network configurations, command line arguments etc

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

.\GRETunnel.exe 192.168.1.12 205.220.230.176 23.183.244.131 10.10.214.14

image

If you need anything else let me know please

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

This command arguments have worked for several windows instances, but doesn't seem to work on some.

from gre_tunnel.

wow0000 avatar wow0000 commented on August 11, 2024

23.183.244.131: Our IP on the tunnel
10.10.214.14: GRE Server IP on the tunnel

Please try to use something like 10.10.214.XXX instead of 23.183.244.131 (If you use an GRE tunnel provider, they should give you the correct value)

23.183.244.131 Could be your Public interface IP if I'm not mistaken
Please let me know if it does help you

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

I will try, however I've ran the command with the public IP provided to me on multiple Windows system, I am curious as to why it won't work like this this time.

(I might take some hours to try it out)

from gre_tunnel.

wow0000 avatar wow0000 commented on August 11, 2024

The issue concerns this part:

const char* bind_ip = argv[3];

MIB_UNICASTIPADDRESS_ROW AddressRow;
InitializeUnicastIpAddressEntry(&AddressRow);
WintunGetAdapterLUID(Adapter, &AddressRow.InterfaceLuid);
AddressRow.Address.Ipv4.sin_family = AF_INET;
inet_pton(AF_INET, bind_ip, &AddressRow.Address.Ipv4.sin_addr.S_un.S_addr);

AddressRow.OnLinkPrefixLength = cidr;
AddressRow.DadState = IpDadStatePreferred;
auto LastError = CreateUnicastIpAddressEntry(&AddressRow);
// LastError -> Windows does not want to assign the IP to the interface

I suspect argv[3] (23.183.244.131) to be incorrect. It should be in the same subnet as the GRE server (10.10.214.14/30) and should use private IP blocks

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

The public IP is statically routed to the private one (or viceversa), if that makes it any different

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

The error goes away if we use private IPs, but the traffic does not get routed to the public IP

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

The issue is solved, however I am unable to route the local gre ip (10.10.214.XXX) to the public IP. Could you give me some insight on this?

from gre_tunnel.

wow0000 avatar wow0000 commented on August 11, 2024

Hello,
I'm sorry for the late in answers, I would need details on what you mean by "route the local gre ip to the public IP". The program should already be doing it for you automatically (if settings are correct)

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

No worries on delays, the software works good just something with my config.

On the GRE endpoint, they have routed the traffic from the GRE remote IP address to the public one we have over the internet.

The traffic does not arrive the public IP so I would like to route traffic from 10.10.XXXX to another public IP.

With some IPs that are valid, I can do a command like this one, and the traffic gets routed to the public IP
.\GRETunnel.exe 192.168.1.12 205.220.230.176 23.183.244.131 10.10.214.14

from gre_tunnel.

wow0000 avatar wow0000 commented on August 11, 2024

If I'm understanding correctly you want to be able to route multiple local IPs to multiple public IPs ? This case is not supported, one way to do it would be to run multiple instance of the software using a smaller CIDR mask and configuring the server accordingly

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

No, I just want 1 local ip to report to 1 public IP

10.10.214.XXX -> XXX.XXX.XXX.XXX

from gre_tunnel.

wow0000 avatar wow0000 commented on August 11, 2024

I see, the software should already be doing that, if it does not, double check your server configuration and/or arguments

Details about arguments:
.\GRETunnel.exe A B C D [E]
A: The network the program should use to communicate with the GRE server (Local ip of the interface)
B: IP the program should send the GRE packets to (the server IP)
C: The IP used as client local IP for the tunnel network
D: The GRE server IP on the tunnel network
E: CIDR of GRE network

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

Yes, this is my current command, however the public IP is not pingable:

.\GRETunnel.exe 192.168.1.172 205.220.230.176 10.10.214.57 10.10.214.58

If I swap out 10.10.214.57 for the public IP, it works but this is not ideal and doesn't work with all public IPs due to being on a different subnet.

from gre_tunnel.

wow0000 avatar wow0000 commented on August 11, 2024

I'm not sure how to help you, it truly looks like a configuration problem. I don't have any testing device available in order to test or debug the software at the moment to reproduce your issue.
Check your NAT/SNAT/Routes on the server side for 10.10.214.X/CIDR

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

I have still not figured this out. Is it possible I need an static route in Window's side?

from gre_tunnel.

wow0000 avatar wow0000 commented on August 11, 2024

The software automatically create a virtual network with the provided settings, you shouldn't have to do anything on your end.

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

The public IP is statically routed in the server, but it cannot be reached after connecting the tunnel.

from gre_tunnel.

wow0000 avatar wow0000 commented on August 11, 2024

If the server cannot be reached, check your firewall rules and networks packets (wireshark). Some hosts may block GRE packets.

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

The firewalls are all off. My host doesn't block GRE packets as if I swap the IPs as stated above it works. I'm lost.

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

Maybe I have fixed it. I added the public IP address to the GRE_Tunnel adapter manually, and the routing is stablished now.

I will be confirming this works, and maybe if you are okay with it add an additional optional param for public IP and make a PR.

from gre_tunnel.

Pelayori avatar Pelayori commented on August 11, 2024

This issue was solved for me, I have made a PR for it if you wish to review it.

Link: #7

from gre_tunnel.

Related Issues (6)

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.