Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPIP6 tunnel #1

Open
ameen-mcmxc opened this issue Dec 29, 2021 · 3 comments
Open

IPIP6 tunnel #1

ameen-mcmxc opened this issue Dec 29, 2021 · 3 comments

Comments

@ameen-mcmxc
Copy link

Hi, I want to encapsulate my IP v4 packet in the IPv6 tunnel just like shown in my topology.

So packets should be encapsulated at B4 and sent to AFTR

image

Which commands are suitable for me?
I have cloned your repo and downloaded "go" on both sides of my tunnel endpoints (B4 & AFTR) machines.

Thanks
Ameen

@m13253
Copy link
Owner

m13253 commented Dec 29, 2021

First, build the program using Go compiler by typing:

./build.sh

The resulting program will be in ./build/ipip. You can move it to other paths at your convenience.

On B4:

sudo ip tuntap add mode tun name tun-aftr
sudo ip address add 10.0.1.1 peer 10.0.1.2/32 dev tun-aftr
sudo ip route replace 198.51.100.0/24 dev tun-aftr
sudo ./build/ipip dev tun-aftr remote 2001:db8:0:1::2 1460 &

On AFTR:

sudo ip tuntap add mode tun name tun-b4
sudo ip address add 10.0.1.2 peer 10.0.1.1/32 dev tun-b4
sudo ip route replace 10.0.0.0/24 dev tun-b4
sudo ./build/ipip dev tun-b4 remote 2001:db8:0:1::1 1460 &

The symbol & means putting the command to background. You will have to use killall to stop the background process.
I am sure you want to automate this procedure. I have provided two methods in the Readme file, one is using systemd on systemd-enabled distros, the other is using /etc/network/interfaces on Debian.
You can check the Readme document to learn how to automate the commands so you don't have to type every time the server is rebooted.

@ameen-mcmxc
Copy link
Author

Thanks for your quick reply.

I noticed that you used "tun-rabbit" in your reply, is that a typo or what ?
So, in B4 side, I should use the following command: -
sudo ./build/ipip dev tun-b4 remote 2001:db8:0:1::2 1460 &

Note: I am using CentOS machines.

@m13253
Copy link
Owner

m13253 commented Dec 29, 2021

I noticed that you used "tun-rabbit" in your reply, is that a typo or what ?

Yes. That was a typo. I fixed it.

I don't use CentOS and don't have plan to support CentOS. But you can use whatever automation tools you have on your distro to automatically execute the commands on system startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants