Difference between revisions of "USB Internet"

From postmarketOS
Jump to: navigation, search
(Created page with "USB Internet Enable Internet on your device by using a usb cable (when wifi does not work). On your phone: X are your pc usb ip address last numbers you will find in network...")
 
Line 1: Line 1:
 
USB Internet
 
USB Internet
 
Enable Internet on your device by using a usb cable (when wifi does not work).
 
Enable Internet on your device by using a usb cable (when wifi does not work).
 +
 
On your phone:
 
On your phone:
  
X are your pc usb ip address last numbers you will find in network manager.
+
X are your pc usb ip address last numbers you will find in your pc's network manager.
 +
 
 
sudo route add default gw 172.16.42.x  
 
sudo route add default gw 172.16.42.x  
  
 
Delete and write instead your router ip address (nameserver 192.168.1.1) or dns server address (nameserver 8.8.8.8)  
 
Delete and write instead your router ip address (nameserver 192.168.1.1) or dns server address (nameserver 8.8.8.8)  
 +
 
sudo nano /etc/resolv.conf  
 
sudo nano /etc/resolv.conf  
 
  
 
On your pc:
 
On your pc:
  
 
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/null
 
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/null
 +
 
sudo iptables -P FORWARD ACCEPT
 
sudo iptables -P FORWARD ACCEPT
 +
 
sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 172.16.42.0/24
 
sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 172.16.42.0/24
 +
 +
You are done! Now try to ping someone!

Revision as of 15:56, 22 September 2017

USB Internet Enable Internet on your device by using a usb cable (when wifi does not work).

On your phone:

X are your pc usb ip address last numbers you will find in your pc's network manager.

sudo route add default gw 172.16.42.x

Delete and write instead your router ip address (nameserver 192.168.1.1) or dns server address (nameserver 8.8.8.8)

sudo nano /etc/resolv.conf

On your pc:

echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/null

sudo iptables -P FORWARD ACCEPT

sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 172.16.42.0/24

You are done! Now try to ping someone!