permacomputing

Source repository for the main permacomputing wiki site
git clone http://git.permacomputing.net/repos/permacomputing.git # read-only access
Log | Files | Refs

commit b7d724ea70d76ae66ac0759f04f1005a291055ab
parent 19147cc4c28e5e3badfb5936e8d971c1b596ffea
Author: ugrnm <ugrnm@web>
Date:   Thu, 21 May 2026 23:59:51 +0200

internet sharing tweaks

Diffstat:
Munbrick01.mdwn | 15++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/unbrick01.mdwn b/unbrick01.mdwn @@ -104,19 +104,20 @@ Now you can SSH into the phone with the username and password set during `pmboot ## Share internet connection -To share your internet connection to the phone run the following commands on your machine: +Run a few commands on your machine and on the phone. You need to know the primary network interface name of your machine from which you are connected to the net. It could be `en0` or `wlan1` or `wlxc0d3d34d`, use `ip a` to find it. + +On your machine: ```sh sudo sysctl net.ipv4.ip_forward=1 -# for OS with iptables use the following: -sudo iptables -t nat -A POSTROUTING -o <your-internet-interface> -j MASQUERADE -# for OS with nftables use the following +# for OS with iptables (you can find your net interface with `ip a`.) +sudo iptables -t nat -A POSTROUTING -o <primary-net-interface> -j MASQUERADE +# for OS with nftables sudo nft add table inet nat sudo nft add chain inet nat postrouting '{ type nat hook postrouting priority srcnat ; }' -sudo nft add rule inet nat postrouting oifname <your-internet-interface> masquerade +sudo nft add rule inet nat postrouting oifname <primary-net-interface> masquerade ``` - -You can find your internet interface with `ip a`. On the phone run the following commands: +On the phone: ``` sudo ip route add default via 172.16.42.2