Skip to main content

Ethernet tethering for Linux - NAT a single device through an interface

Project description

tETHer - ethernet tethering

Tether one device to another over an ethernet interface on linux (rather than USB)

Tethering proxies one device through another devices internet connections. A common use case is to connect to a mobile phone over USB and then use its internet connection. tETHer does the same thing but via an ethernet connection such as an rj-45 cable.

This also allows forwarding

Motivation

I had a camera which only supported wired connection. I did not want to run a long wire to a router and wireless bridges were moderately expensive so I decided to get this working with an old raspberry pi. I don't really like "infrastructure" because I forget how it works. I prefer tools which minimise the amount of infrastructure so I coded this.

Alterantives and prior work

Use a wireless bridge. Hand code the networking yourself using wireless.

This is very similar to the idea of setting up an access point, but it has some additional features for port forwarding which are made easier if you are providing access or a single device.

Installation

tETHer requires nmap dnsmasq and Linux. On a linux machine install them: sudo apt install nmap dnsmasq pipx.

You can then install with pipx: pipx install tETHer

Usage

Set up dhcp and forwarding on eth0 so that if you plug in a device which uses DHCP it will connect to you and then via you to the rest of the network - including the internet.

eth-tether eth0

If you want to forward ports you can capture all the ports that the tethering machine has

eth-tether eth0 --scan ports

Then on subsequent files you can use the generated ports file

eth-tether eth0 --ports ports

To avoid requiring too many permissions, tETHer uses sudo to run privileged commands. You can allow your use to only run these commands or you can run the entire commadn with sudo. To get a sudoers file alowing these commands run eth-tether eth0 --sudoers

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

t_eth_er-1.2.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

t_eth_er-1.2.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file t_eth_er-1.2.0.tar.gz.

File metadata

  • Download URL: t_eth_er-1.2.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for t_eth_er-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e85d2ab3b62886b7223d9bf39c4e40e1e41b274603df6e6e1ca08114d12252d4
MD5 e954e49f4df2185190f58d84246b9460
BLAKE2b-256 3506c1fb9c54e59ea8cc2e2ae0fe25f343c1291c9648a9a735b61b628cfd7657

See more details on using hashes here.

File details

Details for the file t_eth_er-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: t_eth_er-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for t_eth_er-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77c7031868965c846e7f9dc3bb5f304f8203ff0a2be0cd8225cb3e30e4c3474a
MD5 0a593a97e085d917d3fe99220187545f
BLAKE2b-256 1e3ac332edfc3ccc9aa63d3a972bf4afa787c4de18a6403947f37ca72d08d8a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page