Git Product home page Git Product logo

ipbridge's Introduction

ipbridge

Tools to assign public IP in a network to another network through vpn tunneling.

What is this?

This is a tool to assign a public IP available in a network to other networks through VPN connection.

When you have a server (let's call it SERVER A) with a lot of public IPs in a network (NETWORK A), and you have other servers (SERVER B) in other networks (NETWORK B) that have a limited IP, or is behind a firewall, and you want to assign one or more available public IPs in network A to the server in network B through VPN, this tool will help you to achieve that. The traffic transferred between network A and network B will be securely transmitted (encrypted).

Keep in mind that the traffic between the server and the client counts toward your internet bandwidth buckets, so if your provider limits it be aware, that you'll incure twice as much as you normally would. Here's an illustration:

Client -----> Server A -----> Server B ------> Server A -----> Client

How it works?

It works by setting a Softether VPN server in SERVER A, and then setting up a Softether VPN Client in SERVER B, and manually allocate unassigned available IP in NETWORK A to the SERVER B. Of course this is not limited to one-on-one setup, you can actually have a lot of VPN clients on different network to access network A IP pool.

For this to work, you'd need:

  • Available, unassigned IPs in a network (can be in the same subnet as the server IP, or not)
  • A ubuntu 14.04 or debian 8 in both the server and clients (These are the only OS I tested it with, you might need to tweak it to work with other OS).
  • Dedicated Server is preferable as VPS might not work if the IP is automatically assigned to an interface.
  • Some knowledge how to troubleshoot if something goes wrong!
  • Port 443 available in Server A for VPN communication, if you need it for other purpose or want to use different port, you'd need to tweak the script.

WARNING: You might lose remote access connection, data, intellectual property, etc ... if something goes wrong! Handle with care!

How to use it?

Step 1: Gather all the information you'd need: IP Address (e.g. 10.0.0.10), network mask bits (e.g. /24), gateway ip (e.g. 10.0.0.1), and network (e.g. 10.0.0.0).

Step 2: Run vpnserver.sh in SERVER A that you have a lot of IP to share, this will install Softether VPN server and configure it.

wget https://raw.githubusercontent.com/abegodong/ipbridge/master/vpnserver.sh && bash vpnserver.sh

Step 3: Ensure that you unassign IP that you want to use in other servers from the SERVER A virtual network interfaces.

Step 4: Run vpnclient.sh in SERVER B that you want to assign the IP to, this will install Softether VPN client and configure it.

wget https://raw.githubusercontent.com/abegodong/ipbridge/master/vpnclient.sh && bash vpnclient.sh

Step 5: Try to ping other IP in Network A from server B, then wait few minutes and test the new IP (browsing, etc ...).

Step 6: If you need to add more IPs in server B, simply run: ip addr add ${CLIENT_IP}/${CLIENT_NETBLOCK} dev vpn_vpn , for example: ip addr add 10.0.0.10/24 dev vpn_vpn

That's it, you can run vpnclient.sh in other servers as needed.

License?

MIT (see license.txt).

Credits ...

Some parts of this tool are built based on:

And thank you for the awesome folks at University if Tsukuba, Japan who've built the Softether VPN (https://www.softether.org/)

ipbridge's People

Contributors

abegodong avatar

Watchers

James Cloos avatar

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.