FYI, 1and1 hosting fun (ip subnet zero)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

FYI, 1and1 hosting fun (ip subnet zero)

Todd T. Fries-2
I've been told that this is in the archives, but I couldn't find it, so I
re-invented it and am presenting it here for anyone else who may find
themselves in a similarly frustrating situation.

The problem is that 1and1 hosting choses to have any root servers
setup with `ip subnet zero'.  That's a fancy way of stating that they
expect systems to setup IP's with netmasks of 255.255.255.255 and then
route to 10.255.255.1 `magically'.

On a linux system dhcp is able to setup this routing table:

  $ netstat -nr
  Kernel IP routing table
  Destination     Gateway         Genmask         Flags   MSS Window  irtt
Iface
  10.255.255.1    0.0.0.0         255.255.255.255 UH        0 0          0
eth0
  169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0
eth0
  127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
  0.0.0.0         10.255.255.1    0.0.0.0         UG        0 0          0
eth0
  $

To manually implement this when their dhcpd is down (whee!) one would do this:

  # ifconfig eth0 1.2.4.165 netmask 255.255.255.255
  # route add -host 10.255.255.1 netmask 0.0.0.0 dev eth0
  # route add -net default gw 10.255.255.1 dev eth0

Unfortunately, it doesn't work at `home' on OpenBSD.  While the obvious thing
that came to my mind first was to set an inet alias for 10.255.255.2 and set a
default route to 10.255.255.1, this would then send all packets out vr0 with a
src IP of 10.255.255.2, not good.

So to get a similar functionality I implemented this gross `hack #1'
initially:

  $ cat /etc/hostname.vr0
  inet 1.2.4.165 255.255.255.252
  !arp -F -s 1.2.4.166 00:00:0C:07:AC:00 permanent
  $ cat /etc/mygate
  1.2.4.166
  $

Unfortunately this has two drawbacks, namely, the mac address is hardcoded
and there are now three IP's unreachable: 1.2.4.167, 1.2.4.166, 1.2.4.164.

Henning pointed me to the '-llinfo' and '-iface' flags of the route(8)
command,
which permits the following `hack #2'.  Note that both drawbacks of `hack #1'
have been addressed.   This is the best way I've found to deal with
1and1 hosting's odd choice of routing setup:

  $ cat /etc/hostname.vr0
  inet 1.2.4.165 255.255.255.255
  !route add -llinfo -iface -net 10.255.0.0/16 10.255.255.1 -ifp vr0
  $ cat /etc/mygate
  10.255.255.1
  $ netstat -nr -f inet
  Routing tables

  Internet:
  Destination        Gateway            Flags     Refs     Use    Mtu  
Interface
  default            10.255.255.1       UGS        17    44379      -   vr0
  10.255/16          link#1             UCLS        1        0      -   vr0
  10.255.255.1       0:0:c:7:ac:0       UHLc        1        0      -   vr0
  127/8              127.0.0.1          UGRS        0        0  33224   lo0
  127.0.0.1          127.0.0.1          UH          2      101  33224   lo0
  1.2.4.165          0:40:ca:12:34:56   UHLc        0       14      -   lo0 =>
  1.2.4.165          link#1             UC          1        0      -   vr0
  224/4              127.0.0.1          URS         0        0  33224   lo0
  $ arp -an
  ? (10.255.0.0) at (incomplete) on vr0(weird 6)
  ? (10.255.255.1) at 00:00:0c:07:ac:00 on vr0
  ? (1.2.4.165) at 00:40:ca:12:34:56 on vr0 static
  $

Yes, I changed the IP and mac of the colo I'm taking care of at 1and1; I left
the IP and mac of 1and1's subnet zero mess intact to provide maximal help to
anyone experiencing this same hosting provider.

No, 1and1 does not `support' OpenBSD as an os.  To install OpenBSD, I
dissected
yaifo and realized that one can pepare a disk image with no fdisk label but
simply a disklabel.  This image can be made bootable, and it can be dd'ed
directly to any disk.  This is similar but destructively different than dd'ing
the filesystem image to the swap partition on sparc.  Since I had special
routing issues and 1and1 does provide serial console, I didn't really need
yaifo's custom sshd setup.

FYI ;-)
--
Todd Fries .. [hidden email]

 _____________________________________________
|                                             \  1.636.410.0632 (voice)
| Free Daemon Consulting, LLC                 \  1.405.227.9094 (voice)
| http://FreeDaemonConsulting.com             \  1.866.792.3418 (FAX)
| "..in support of free software solutions."  \          250797 (FWD)
|                                             \
 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
                                                 
              37E7 D3EB 74D0 8D66 A68D  B866 0326 204E 3F42 004A
                        http://todd.fries.net/pgp.txt

Reply | Threaded
Open this post in threaded view
|

Re: FYI, 1and1 hosting fun (ip subnet zero)

Thorsten Glaser-3
(keeping cross-post of original poster because I
 don't have a better idea)

Todd T. Fries dixit:

>The problem is that 1and1 hosting choses to have any root servers
>setup with `ip subnet zero'.  That's a fancy way of stating that they
>expect systems to setup IP's with netmasks of 255.255.255.255 and then
>route to 10.255.255.1 `magically'.

Ah, they're doing it the same as Strato then.

Thanks to Matthias Kilian for discovering the following fix:

(hostname.fxp0)
inet 1.2.3.4 0xFFFFFFFF NONE
!route -n add -inet -host 5.6.7.8 -link -iface fxp0:
!route -n add -inet default 5.6.7.8

It does suck somehow, though. There are arp messages in dmesg.

bye,
//mirabile
--
> emacs als auch vi zum Kotzen finde (joe rules) und pine f|r den einzig
> bedienbaren textmode-mailclient halte (und ich hab sie alle ausprobiert). ;)
Hallooooo, ich bin der Holger ("Hallo Holger!"), und ich bin ebenfalls
... pine-User, und das auch noch gewohnheitsmd_ig ("Oooooooohhh").  [aus dasr]