Difference between revisions of "OpenWRT: Routing ke usb tethering"

From OnnoWiki
Jump to navigation Jump to search
(Created page with "On the Smartphone Enable USB Tethering on your Smartphone and connect it with the USB cable to your routers USB port. On the router Use the new usb0 (or for some cases eth1)...")
 
 
Line 6: Line 6:
 
Use the new usb0 (or for some cases eth1) network device as WAN connection and set the protocol to DHCP client mode.
 
Use the new usb0 (or for some cases eth1) network device as WAN connection and set the protocol to DHCP client mode.
  
uci del network.wan
+
uci del network.wan
uci set network.wan=interface
+
uci set network.wan=interface
uci set network.wan.ifname=usb0
+
uci set network.wan.ifname=usb0
uci set network.wan.proto=dhcp
+
uci set network.wan.proto=dhcp
uci commit network
+
uci commit network
  
After commiting the changes to the network configuration bring up the WAN interface to obtain an IP, gateway and DNS address from your Smartphones DHCP server.
+
After commiting the changes to the network configuration bring up the WAN interface to obtain an IP, gateway and DNS address from your Smartphones DHCP server.
  
ifup wan
+
ifup wan
 +
 
 +
 
 +
Testing the connection
 +
 
 +
Login to the OpenWrt router with SSH at 192.168.1.1.
 +
With logread
 +
 
 +
logread
 +
 
 +
With ifconfig
 +
 
 +
ifconfig $(uci get network.wan.ifname)
 +
 
 +
With ping
 +
 
 +
ping -c 4 www.google.com

Latest revision as of 09:17, 10 September 2017

On the Smartphone

Enable USB Tethering on your Smartphone and connect it with the USB cable to your routers USB port. On the router

Use the new usb0 (or for some cases eth1) network device as WAN connection and set the protocol to DHCP client mode.

uci del network.wan
uci set network.wan=interface
uci set network.wan.ifname=usb0
uci set network.wan.proto=dhcp
uci commit network

After commiting the changes to the network configuration bring up the WAN interface to obtain an IP, gateway and DNS address from your Smartphones DHCP server.

ifup wan


Testing the connection

Login to the OpenWrt router with SSH at 192.168.1.1. With logread

logread

With ifconfig

ifconfig $(uci get network.wan.ifname)

With ping

ping -c 4 www.google.com