Page 2 of 5 FirstFirst 12345 LastLast
Results 11 to 20 of 42
Discuss [Project] iPhone as a 3G router at the Free Toolchain Software (Cydia App's) - Hackint0sh.org; Long ago, just after the first unlock for the 2G was released this was my ...
  1. #11
    The Man Array aviegas's Avatar

    Join Date
    Sep 2007
    Posts
    1,108
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    73

    Default

    Long ago, just after the first unlock for the 2G was released this was my first project.

    The problem is not getting DHCP or Bonjour to work (you do not need bonjour at all).

    The iPhone will connect to the "celular data network" (3G, EDGE or GPRS) and get an IP address, normally an IP with Internet connectivity (outside of the private range).

    The WLAN interface will be able to assign private addresses. It's ok and doable.

    But you need to be able to "route" the packages with NAT, that is not only forward packages from one interface to the other, but change the package headers to allow sharing the single valid IP.

    iPhoneOS is nothing more than a crippled version of MacOS, so the same structure is there. But the necessary kernel extensions are missing.

    First, you need "ipfw" to control NAT routing parameters in the kernel. although we can compiled the user level command, it's impossible to add IP_FW support to kernel (or non trivial). Here is the results we got last year:

    Code:
    # ifconfig
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
            inet 127.0.0.1 netmask 0xff000000 
    en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
            inet 172.16.2.1 netmask 0xffffff00 broadcast 172.16.2.255
            ether 00:1c:b3:09:8b:84 
    ip1: flags=8011<UP,POINTOPOINT,MULTICAST> mtu 1450
            inet 189.40.30.173 --> 189.40.30.173 netmask 0xffffffff 
    ip2: flags=8011<UP,POINTOPOINT,MULTICAST> mtu 1500
    
    # sysctl -w net.inet.ip.forwarding=1
    net.inet.ip.forwarding: 0 -> 1
    
    # natd -interface ip1
    
    # ipfw -f flush
    ipfw: setsockopt(IP_FW_FLUSH): Protocol not available
    
    # ipfw add divert natd all from any to any via ip1 
    ipfw: getsockopt(IP_FW_ADD): Protocol not available
    So, unless we find the proper kernel sources to replace the kernel on the phone, we are stuck. I may be wrong and I would love to see someone proving me wrong.


  2. #12
    Newbie Array

    Join Date
    Mar 2007
    Posts
    8
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Yes, I see. I had been considering the problem of getting the wifi chipset to operate in ad-hoc mode, but this is also a problem. Is it possible yet for users to compile kernel extensions (*.kext files) - I know that this is how drivers get installed on MacOS, and it wouldn't require kernel source - just headers...

    -Patrick

  3. #13
    Newbie Array

    Join Date
    Sep 2007
    Posts
    9
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by kalfalfa View Post
    Yes, I see. I had been considering the problem of getting the wifi chipset to operate in ad-hoc mode, but this is also a problem. Is it possible yet for users to compile kernel extensions (*.kext files) - I know that this is how drivers get installed on MacOS, and it wouldn't require kernel source - just headers...

    -Patrick
    The more I think about this, the more I see the problem... Is there a way to get around needing ipfw?

    I'm excited to see more minds come together on this.

    As a backup plan, do you think it would be possible to get the iPhone to throw a signal to a separate router?
    Last edited by stormj; 07-29-2008 at 12:55 AM.

  4. #14
    Newbie Array

    Join Date
    Mar 2007
    Posts
    8
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    The problem is that this can't be done in userland, and if it is not implemented in the kernel, then that makes things much more difficult. The ipfw utility as an example, is failing on kernel calls. But I will continue looking into this, I have a lot to learn about the darwin kernel, I know much more about linux.

    -Patrick

  5. #15
    Rookie Array

    Join Date
    Apr 2008
    Posts
    18
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by kalfalfa View Post
    The problem is that this can't be done in userland, and if it is not implemented in the kernel, then that makes things much more difficult. The ipfw utility as an example, is failing on kernel calls. But I will continue looking into this, I have a lot to learn about the darwin kernel, I know much more about linux.

    -Patrick
    This parallels my problem with OpenVPN as shown in this thread. Need some OS X kernel hackers for these kexts!


  6. #16
    Newbie Array

    Join Date
    Sep 2007
    Posts
    9
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by kalfalfa View Post
    The problem is that this can't be done in userland, and if it is not implemented in the kernel, then that makes things much more difficult. The ipfw utility as an example, is failing on kernel calls. But I will continue looking into this, I have a lot to learn about the darwin kernel, I know much more about linux.

    -Patrick
    Is it that it can't be done in userland or that the implementation they're using here relies on kernel calls?

    Again--I'm way out of my depth here, but is it correct that we can't read from one socket, change the packet, and send to the other socket in userland? If we can do that shouldn't we be able to implement our own NAT code?

    Hmph.

  7. #17
    Newbie Array

    Join Date
    Mar 2007
    Posts
    8
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    low level packet manipulations have to be done at the kernel level, but I imagine that we can deal with this - there must be some amount of the functionality we need implemented. I'm still more concerned about getting the wifi chip into ad-hoc mode. The iPhone seems to have almost all of it's kernel drivers compiled into the kernel, and we can't recompile the kernel, so if we want to add kernel functionality, we would need to make .kext kernel extensions, which do appear to be supported. This is just (very) hard - implementing things like packet filtering and a wifi chip driver, etc. Note that at this point even available linux code is pretty far off as we're dealing with the darwin (XNU) kernel.

    -Patrick
    Last edited by kalfalfa; 07-30-2008 at 08:26 PM.

  8. #18
    Rookie Array ViciousEternal's Avatar

    Join Date
    Jul 2008
    Location
    Seattle, Washington
    Posts
    20
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I don't have much programing experience, but as a graphic designer I am more than willing to do art for this project when the time arises. I would love for this to work.

  9. #19
    Newbie Array

    Join Date
    Sep 2007
    Posts
    9
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default Question...

    ...if NetShare can run as a userland app, what exactly is it doing that is that much different from NAT?

    By the way, this would seem to foster the conclusion above that getting the wireless into AP mode may be the problem—NullRiver doesn't have it do that.

  10. #20
    Newbie Array

    Join Date
    Mar 2007
    Posts
    8
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    NetShare just runs a socks proxy in the background, it's the same solution as we already get for free with jailbreaking. Even if ad-hoc was possible it wouldn't be something that an app-store app could do so the fact that they don't doesn't really mean anything.

    -Patrick


 

 
Page 2 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. MacNN: TP-Link intros 802.11n pocket router, portable 3G router
    By hackint0sh in forum Latest Headlines
    Replies: 0
    Last Post: 11-17-2011, 04:20 AM
  2. Replies: 0
    Last Post: 07-29-2010, 05:20 AM
  3. iphone 3g as wifi router?
    By bigfish2 in forum Free Toolchain Software (Cydia App's)
    Replies: 2
    Last Post: 06-21-2009, 10:18 PM
  4. iPhone Router/Gateway/NAT - possible?
    By leshric in forum General
    Replies: 0
    Last Post: 07-25-2008, 04:35 PM
  5. [Req] Using the iPhone as a wireless router?
    By geuis dassin in forum Free Toolchain Software (Cydia App's)
    Replies: 2
    Last Post: 03-08-2008, 05:18 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 04:25 PM.
twitter, follow us!