# Gentoo server blocks iPhone/iPad

## MacGyver031

Hi,

I have the following network:

Wireless AP -> Switch -> Gentoo server (iptables, dhcp, bind) -> internet.

At the moment I am using DLink DIR-615 router, with switched off routing/dhcp as access point.

What works:

Two laptops running Gentoo works fine with this setup (no problem with the wireless connection).

An iPad (generation 1) which works about 3hours after I have connected to the wlan, and this works until I have connected to an other wlan, without any problem.

What causes pain in the a*:

But all other Apple iPhones (3 and 4) and iPads (tested on generation 2) work erratically or even not. I have access to all other devices on the lan, except the gateway. The most funny thing is that dhcp always works! All Apple devices receive valid IP address, gateway and dns-resolver, so I assume it must be an Apple bug: I have to say that my private network has 192.168.x.0/24, where x is greater than 25.

tcpdump showed that no packets arrive at the gateway. As soon as I mirror the port where the AP is connected, the iPhone works.

I have seen this problem with following AP: DLink DIR-615, Zyxel G-570S and Netgear DG834G

The problem is persistent on the following switch: HP ProCurve 2626 and Cisco C2960G

DHCP.CONF:

```
option domain-name "inside.lan.com";

option domain-name-servers 192.168.x.1;

default-lease-time 7200;

max-lease-time 43200;

server-identifier 192.168.x.1;

authoritative;

ddns-update-style interim;

zone inside.lan.com. {

        primary 192.168.x.1;

        }

zone x.168.192.in-addr.arpa. {

        primary 192.168.x.1;

        }

class "openvpn" {

        match if substring (hardware, 1, 2) = FF:FF;

}

subnet 192.168.x.0 netmask 255.255.255.0 {

        pool {

                deny members of "openvpn";

                option routers 192.168.x.1;

                option subnet-mask 255.255.255.0;

                range 192.168.x.16 192.168.x.64;

                option broadcast-address 192.168.x.255;

                }

        pool {

                allow members of "openvpn";

                range 192.168.x.65 192.168.x.72;

                }

        }

```

----------

## gerdesj

From your description of the problem, give up on Apple stuff!  However, I know from general experience that this is probably not necessary.

So, we need to break your problem down and fix it.  Your description is not quite enough.

You say that your clients (iPhone) get correctly configured - IP address, router etc.  So we need to see where the failure actually occurs.

Run tcpdump on your router (Gentoo box) whilst trying to access something external from the iThing.  What happens? If you need some help on setting this up, post back and I'll step you through it.

Cheers

Jon

----------

## MacGyver031

Hi Jon,

 *gerdesj wrote:*   

> Run tcpdump on your router (Gentoo box) whilst trying to access something external from the iThing.  What happens?

 

I have setup following scenarios:

1) Tcpdump on Gentoo router: I switch on the iPhone, I see traffic of DHCP-request and multiple mdns request on 224.0.0.0* and then as soon as I go to Safari, there is no request arriving at my router. But when I try to access the webpage of my webpage testing system, it works. It is just the default gateway which seems to be corrupted in the iPhone/iPad

2) Port mirroring on the cisco switch: I start wireshark on the laptop, I access Safari and the damn iPhone works! I have tried this twice. I will be trying this this weekend again.

3) If I do a forget network and reconnect to WLan, iPhone works erratically (sometimes it works(10%), other times not(90%))

 *gerdesj wrote:*   

> give up on Apple stuff!

 

Already in the pipeline, but my brother and many friends have iPhone/iPad and it is sometime a little embrassing to say that Apple product is unsupported.

I have the feeling that iPhone/iPad might have problem with 192.168.x.0 where x > 11, because the time I was using 192.168.1.0/24, I have seen that the former iPhone worked without any problems. At the office with 192.168.1.0/24 and 192.168.11.0/24 it works well too.

At the moment it is a bit difficult to change my IP range to 192.168.1.0/24 for testing (NFS, syslog, rsync for gentoo-portage and many other network applications are setup with IP adress instead of domainname on various gentoo boxes)

To sum up: iPhone works on other network, except on the private router (internal network works, i.e. seems to have a huge problem with the default gateway, everywhere where the default gateway was withing the third octet < 12, worked without problems). HP laptop as well as MacBook Pro, both running Gentoo, have no issues with the gateway. Alix wrap board with a netgear USB-WLan adapter, running voyage-linux works too. I have seen that (it has been a while) WinXP (2 maschines) worked without any issues too.

I have searched the internet concerning the bug (I think that the problem might be appearing after 192.168.16.0/24), but found nothing yet.

BR

----------

## gerdesj

Sorry for the delay in replying.

This is is starting to sound like witchcraft! There is something else there.

My office network is 192.168.100.0/24 and I have several iThings running.  A customer has .1. and .2. and that works as well.

Step away from the problem for a while, think about it, break things down to the absolute basics.  The solution will hit you eventually.

Cheers

Jon

----------

## MacGyver031

So in the meantime my brother has upgraded his iPad and iPhone to IOS 5 (developper have access in the forehand) and he had no problem in getting to the internet. So I am waiting for Apple to release ios 5 to test if my iPhone works too. So hang with me.

----------

