{"id":13550924,"url":"https://github.com/m13253/userland-ipip","last_synced_at":"2025-04-14T15:40:31.825Z","repository":{"id":147643123,"uuid":"245598979","full_name":"m13253/userland-ipip","owner":"m13253","description":"Userland IPIP + IP6IP (6in4) / IPIP6 + IP6IP6 tunnel for Linux","archived":false,"fork":false,"pushed_at":"2020-08-05T04:46:28.000Z","size":41,"stargazers_count":26,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T04:34:51.251Z","etag":null,"topics":["6in4","ipip","ipv6","linux","networking","tunnel"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m13253.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-07T08:56:11.000Z","updated_at":"2025-02-24T13:50:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4d282a2-2bf4-4720-a0eb-1d2c48ac26bb","html_url":"https://github.com/m13253/userland-ipip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m13253%2Fuserland-ipip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m13253%2Fuserland-ipip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m13253%2Fuserland-ipip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m13253%2Fuserland-ipip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m13253","download_url":"https://codeload.github.com/m13253/userland-ipip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248907797,"owners_count":21181399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["6in4","ipip","ipv6","linux","networking","tunnel"],"created_at":"2024-08-01T12:01:39.650Z","updated_at":"2025-04-14T15:40:31.803Z","avatar_url":"https://github.com/m13253.png","language":"Go","funding_links":[],"categories":["Go","linux"],"sub_categories":[],"readme":"# userland-ipip\n\nUserland IPIP + IP6IP (6in4) / IPIP6 + IP6IP6 tunnel for Linux\n\nuserland-ipip sets up either an IPIP + IP6IP (6in4) tunnel, or an IPIP6 + IP6IP6\ntunnel between two hosts.\n\n## Features\n\n- userland-ipip reduces headache when you find that a `type ip6tnl mode any`\n  tunnel is not as reliable as you assume. Either IPv4 or IPv6 payload drops\n  silently at some magic time. You tried various methods, only to find that a\n  system reboot can solve the problem auto-magically.\n\n- userland-ipip calculates `local` address automatically, saving you time to\n  write scripts for an DHCP-assigned host.\n\n- userland-ipip also solves the problem when you want to fragment your tunnel.\n  (i.e. inner MTU larger than outer MTU.)\n\n## Building\n\n1. Download Go compiler. The newer version, the better.\n\n2. Type\n```bash\n./build.sh\n```\n\n3. Pick your fruit at `./build/ipip`.\n\n## Usage\n\n```\nUsage: ipip [-4 | -6] dev DEVICE [local ADDRESS] remote ADDRESS [mtu MTU]\nUserland IPIP + IP6IP (6in4) / IPIP6 + IP6IP6 tunnel for Linux.\n\nThis program establishes IPIP and IP6IP (6in4) tunnel, or IPIP6 and IP6IP6\ntunnel on a TUN device.\n\nOptions:\n  -4            use IPv4 to resolve addresses.\n  -6            use IPv6 to resolve addresses.\n                  otherwise, IPv6 will be tried first, then IPv4.\n\nProject web page: https://github.com/m13253/userland-ipip\n```\n\n## Example\n\nPlease change the names and the addresses below to suit your needs.\n\nOn the first machine (e.g. fox.localdomain)\n```bash\nsudo ip tuntap add mode tun name tun-rabbit\nsudo ip address add 10.0.0.1 peer 10.0.0.2/32 dev tun-rabbit\nsudo ip address add fd00:cafe::1 peer fd00:cafe::2/128 dev tun-rabbit\nsudo ./build/ipip dev tun-rabbit remote rabbit.localdomain mtu 1460\n```\n\nOn the second machine (e.g. rabbit.localdomain)\n```bash\nsudo ip tuntap add mode tun name tun-fox\nsudo ip address add 10.0.0.2 peer 10.0.0.1/32 dev tun-fox\nsudo ip address add fd00:cafe::2 peer fd00:cafe::1/128 dev tun-fox\nsudo ./build/ipip dev tun-fox remote fox.localdomain mtu 1460\n```\n\nTo stop the tunnel, press `Ctrl-C`, then type\n```bash\nsudo ip link delete tun-rabbit\n```\nor\n```bash\nsudo ip link delete tun-fox\n```\n\n## Preventing “connection refused”\n\nYou may find a lot of “connection refused” on the screen. They are caused by\nthe remote machine sending ICMP errors to us.\n\nIt is suggested to block these packets to save bandwidth. A dirty but effective\nmethod is to use iptables on both sides running userland-ipip:\n```bash\nsudo iptables -A OUTPUT -d [PEER IPv4 ADDRESS] -p icmp --icmp-type 3/3 -j DROP\nsudo ip6tables -A OUTPUT -d [PEER IPv6 ADDRESS] -p icmpv6 --icmpv6-type 1/4 -j DROP\n```\n\n## Use userland-ipip with systemd\n\nI don't provide a systemd service file out-of-the-box, since you may want to\nwrite one systemd service for each tunnel you want to create.\n\nHere is a template that you can modify based on:\n```systemd\n[Unit]\nDescription=Userland IPIP for rabbit.localdomain\nDocumentation=https://github.com/m13253/userland-ipip\nAfter=network.target\n\n[Service]\nExecStartPre=-/usr/bin/env ip tunnel delete tun-rabbit\nExecStartPre=/usr/bin/env ip tuntap add mode tun name tun-rabbit\nExecStartPre=/usr/bin/env ip address add 10.0.0.1 peer 10.0.0.2/32 dev tun-rabbit\nExecStartPre=/usr/bin/env ip address add fd00:cafe::1 peer fd00:cafe::2/128 dev tun-rabbit\nExecStart=/path/to/ipip dev tun-rabbit local fox.localdomain remote rabbit.localdomain mtu 1460\nExecStopPost=/usr/bin/env ip tunnel delete tun-rabbit\nRestart=always\nRestartSec=3\nType=simple\n\n[Install]\nWantedBy=multi-user.target\n```\n\n## Use userland-ipip with `/etc/network/interfaces`\n\n```conf\nauto tun-rabbit\niface tun-rabbit inet static\n    address 10.0.0.1\n    pointopoint 10.0.0.2\n    pre-up ip tuntap add mode tun name $IFACE\n    up /path/to/ipip dev $IFACE local fox.localdomain remote rabbit.localdomain mtu 1460 \u0026\n    post-down ip link del $IFACE\niface tun-rabbit inet6 static\n    address fd00:cafe::1/128\n    up ip route add fd00:cafe::2 dev $IFACE metric 256\n```\n\n## License\n\nThis program is released under GNU General Public License version 3 or later.\nI hope this program can be useful to you. But I provide **absolutely no\nwarranty**. In case the program causes any damage due to malfunctioning, I might\nbe willing to diagnose and fix the problem, but it is not my obligation to\ndo so.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm13253%2Fuserland-ipip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm13253%2Fuserland-ipip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm13253%2Fuserland-ipip/lists"}