You don't need to touch /etc/wpa_supplicant.conf.I know that delete my wifis in wpa_supplicant.conf and
192.168.43.1), e.g.:% ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=0
ether ...
inet 192.168.43.147 netmask 0xffffff00 broadcast 192.168.43.255
groups: wlan
...
% netstat -rn4
Routing tables
Internet:
Destination Gateway Flags Netif Expire
default 192.168.43.1 UGS wlan0
127.0.0.1 link#2 UH lo0
192.168.43.0/24 link#6 U wlan0
192.168.43.147 link#2 UHS lo0
ue0 gets an IP from the ue0 connected DHCP server but the default gateway will stay on the wifi router (check with netstat -rn4).!! METHOD 1: The ue0 interface is not created yet
# service netif stop wlan0
Stopping wpa_supplicant.
Waiting for PIDS: 13402.
Stopping Network: wlan0.
...
Destroyed wlan(4) interfaces: wlan0.
!! If this is a phone, activate USB tethering on the phone, the rest is configured automatically
!! METHOD 2: the ue0 interface is already created
# service netif stop wlan0
# dhclient ue0
DHCPREQUEST on ue0 to 255.255.255.255 port 67
DHCPACK from 192.168.42.129
bound to 192.168.42.64 -- renewal in 1800 seconds.
# netstat -rn4
Routing tables
Internet:
Destination Gateway Flags Netif Expire
default 192.168.42.129 UGS ue0
127.0.0.1 link#2 UH lo0
192.168.42.0/24 link#5 U ue0
192.168.42.64 link#2 UHS lo0
192.168.43.1 to the ue0 gateway 192.168.42.129# service netif stop ue0
# service netif start wlan0
!! check default gateway
# netstat -rn4