Hello,
I personally have an iPhone 4s with the failed Broadcom wifi/bt chip. And as such, there is no internet. And I have been all over the internet looking at guides which claim to work but need a functioning network interface to work. I finally figured out how to do this so that it doesn't require any functioning network interface. You must have a unix-like computer for this, windows won't work. I use macOS. You will need network-cmds, netcat and optionally adv-cmds for things like ps aux to determine pppd processes. You will also need a vpn server that iOS supports natively (pptp, IPSec, l2tp over IPSec) if you want to connect to domain names and resolve dns.
get iproxy or mobiledevice from home-brew. Make sure openssh is installed before you run anything, if not then hopefully you installed afc2add before your phone lost wifi because without either then you're stuck. Then run the command appropriate such that:
--port 22 is forwarded to a port on your computer (I used 2022)
--another port is ALSO forwarded to ANOTHER port on your computer (This is where the ppp tunnel will run through, I used port 4444)
I used public key authentication to avoid entering passwords when sshing to either device. run ssh-keygen -t rsa and then copy all the files it generates to your computers home folder/.ssh now copy id_rsa.pub to your idevice. copy that to the folder /var/root/.ssh (create folders if needed) and then just "cat id_rsa.pub >> /var/root/.ssh/authorized_keys" now login to your device. likely the command ssh root@localhost -p 2022 will work. it it worked there should be no password asked and you should now be sitting at a bash prompt. Note that proxy only works if the connection is initiated from the computer, keep this in mind. next, enter the following command:
pppd noipdefault nodetach pty "nc -l -p 4444 localhost" where 4444 is your desired port. then on the host computer, enter this command:
pppd 172.16.1.2:172.16.1.3 proxyarp usehostname ms-dns 8.8.8.8 nodetach noauth ipcp-accept-local ipcp-accept-remote pty "nc localhost 4444"
run the idevice command first as that has nc listening. then run the computer command. hopefully if everything was laid out correctly the two pppd's should talk to each other and mention their respective host and remote ip addresses. Now, following my 172.16 example, do a "route add 172.16.0.0 172.16.1.2" this should make all connections to those addresses (172.16.x.x) go through the tunnel. If you're like me and your computer is also on a 172.16 subnet, then you're done there. If your vpn server is also on that same subnet then you're also done there. If your vpn server is outside of that, or even a commercial vpn provider outside your lan, then just get their external IP address and route x.x.x.x 172.16.1.2 it so it goes through the tunnel. Now, if all you want to do is talk to ip's you routed, you're done. But, if you want to access the internet via hostnames and not ip addresses, then you need to configure an iOS vpn. just go into settings, vpn, and set it up just like normal. It should connect, and you have access to the internet! no limitations. However, you may notice we are double tunneling through. The reason for this is because iOS does not detect the pppd connection as being internet. I tried scutil --nwi and with a real vpn connected it shows it. but with our pppd level tunnel it does not. So, in order to only use 1 tunnel, we need to be able to do one of 2 things:
1) have the pppd-netcat (ppp0) tunnel be detected as a legitimate internet source by scutil --nwi.
2) Use a vpn and tunnel it through iproxy. not feasible as no supported vpns are tcp only (pptp uses ip protocol gre, l2tp uses its own or udp 4500 nat-t, IPSec also) potentially we could relay udp to tcp and use a netcat trick to get udp 500 and 4500 for l2tp and IPSec through via tcp and undo it at the other side, but that's just bypassing the problem not fixing it)
for 1) I tried scutil and getting various keys. nada. my tunnel device (ppp0) isn't considered real. If someone could show me how to add a network interface to scutil or the like that would be greatly appreciated. Otherwise, that's the solution we'll get. Note that if we do a "route default 172.16.1.2" with the pppd tunnel only we can connect to external ips normally with safari! but not domain names. The dns keys in scutil may have something to do with this. Any help provided for either of these would be greatly appreciated.
iphone2g&3gfan
I personally have an iPhone 4s with the failed Broadcom wifi/bt chip. And as such, there is no internet. And I have been all over the internet looking at guides which claim to work but need a functioning network interface to work. I finally figured out how to do this so that it doesn't require any functioning network interface. You must have a unix-like computer for this, windows won't work. I use macOS. You will need network-cmds, netcat and optionally adv-cmds for things like ps aux to determine pppd processes. You will also need a vpn server that iOS supports natively (pptp, IPSec, l2tp over IPSec) if you want to connect to domain names and resolve dns.
get iproxy or mobiledevice from home-brew. Make sure openssh is installed before you run anything, if not then hopefully you installed afc2add before your phone lost wifi because without either then you're stuck. Then run the command appropriate such that:
--port 22 is forwarded to a port on your computer (I used 2022)
--another port is ALSO forwarded to ANOTHER port on your computer (This is where the ppp tunnel will run through, I used port 4444)
I used public key authentication to avoid entering passwords when sshing to either device. run ssh-keygen -t rsa and then copy all the files it generates to your computers home folder/.ssh now copy id_rsa.pub to your idevice. copy that to the folder /var/root/.ssh (create folders if needed) and then just "cat id_rsa.pub >> /var/root/.ssh/authorized_keys" now login to your device. likely the command ssh root@localhost -p 2022 will work. it it worked there should be no password asked and you should now be sitting at a bash prompt. Note that proxy only works if the connection is initiated from the computer, keep this in mind. next, enter the following command:
pppd noipdefault nodetach pty "nc -l -p 4444 localhost" where 4444 is your desired port. then on the host computer, enter this command:
pppd 172.16.1.2:172.16.1.3 proxyarp usehostname ms-dns 8.8.8.8 nodetach noauth ipcp-accept-local ipcp-accept-remote pty "nc localhost 4444"
run the idevice command first as that has nc listening. then run the computer command. hopefully if everything was laid out correctly the two pppd's should talk to each other and mention their respective host and remote ip addresses. Now, following my 172.16 example, do a "route add 172.16.0.0 172.16.1.2" this should make all connections to those addresses (172.16.x.x) go through the tunnel. If you're like me and your computer is also on a 172.16 subnet, then you're done there. If your vpn server is also on that same subnet then you're also done there. If your vpn server is outside of that, or even a commercial vpn provider outside your lan, then just get their external IP address and route x.x.x.x 172.16.1.2 it so it goes through the tunnel. Now, if all you want to do is talk to ip's you routed, you're done. But, if you want to access the internet via hostnames and not ip addresses, then you need to configure an iOS vpn. just go into settings, vpn, and set it up just like normal. It should connect, and you have access to the internet! no limitations. However, you may notice we are double tunneling through. The reason for this is because iOS does not detect the pppd connection as being internet. I tried scutil --nwi and with a real vpn connected it shows it. but with our pppd level tunnel it does not. So, in order to only use 1 tunnel, we need to be able to do one of 2 things:
1) have the pppd-netcat (ppp0) tunnel be detected as a legitimate internet source by scutil --nwi.
2) Use a vpn and tunnel it through iproxy. not feasible as no supported vpns are tcp only (pptp uses ip protocol gre, l2tp uses its own or udp 4500 nat-t, IPSec also) potentially we could relay udp to tcp and use a netcat trick to get udp 500 and 4500 for l2tp and IPSec through via tcp and undo it at the other side, but that's just bypassing the problem not fixing it)
for 1) I tried scutil and getting various keys. nada. my tunnel device (ppp0) isn't considered real. If someone could show me how to add a network interface to scutil or the like that would be greatly appreciated. Otherwise, that's the solution we'll get. Note that if we do a "route default 172.16.1.2" with the pppd tunnel only we can connect to external ips normally with safari! but not domain names. The dns keys in scutil may have something to do with this. Any help provided for either of these would be greatly appreciated.
iphone2g&3gfan