0

I'm setting up 2 mailservers (Postfix) with heartbeat failover & drbd shared maildirs. For some reason, when starting the heartbeat, the default gateway is lost. Any idea how / why this happens and what the solution is?

/etc/network/interfaces:

# The loopback network interface
auto lo
iface lo inet loopback

# eth0: ip of this node
auto eth0
allow-hotplug eth0
iface eth0 inet static
        address 192.168.2.3
        gateaway 192.168.2.46
        netmask 255.255.255.0
# eth0:0: ip address which heartbeat is supposed to take over
iface eth0:0 inet static
        address 192.168.2.5
        netmask 255.255.255.0

/etc/ha.d/haresources:

mx1 IPaddr::192.168.2.5
mx1 drbddisk::r0 Filesystem::/dev/drbd0::/syncdata::ext3 nfs-kernel-server

Failover works fine, but a the default gateway is lost as soon as heartbeat starts it seems (so, also after booting / not yet taking anything over). So far, the only thing I can think of is adding a route add default gw 192.168.2.46 in post-up & post-down of eth0:0, but that seems rather ugly....

quanta
  • 51,413
  • 19
  • 159
  • 217
Wrikken
  • 981
  • 9
  • 22

1 Answers1

2

Is this an actual typo in your config?

    gateaway 192.168.2.46

Should be

    gateway 192.168.2.46
Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
  • 1
    OMFG... Pfft.... I probably moved things around to much with getting it to work I totally missed this... Fixing now, and if this was the problem all along, you have the right to call me an idiot for a full year... – Wrikken Oct 26 '11 at 12:15
  • 1
    Don't worry, mistakes like that do happen all the time. That's why it's good to have an extra eye pair looking at the config files :) – Janne Pikkarainen Oct 26 '11 at 12:17
  • Even after knowing there was an error here, I had to read it twice to find it :) – Chris N Oct 26 '11 at 12:19
  • @Chris N: I spotted that because the vertical alignment of text was wrong. The words `address`, `network`, `netmask` and `gateway` in `/etc/network/interfaces` all contain seven characters, so the `gateaway` line being unaligned immediately got my attention. :-) Yes I know, I probably have seen that file too many times in my life. – Janne Pikkarainen Oct 26 '11 at 12:22
  • Yup, extra eyes help a lot ;). Confirmed this was the one & only problem, thanks! – Wrikken Oct 26 '11 at 12:24
  • @Wrikken: Solved? YOU IDIOT! :P – Janne Pikkarainen Oct 26 '11 at 12:24
  • Hehe ;) A whole year.... ouch. – Wrikken Oct 26 '11 at 12:36
  • @Wrikken: I'm tempted to reserve `iswrikkenstillanidiot.com` and make it return `YES` until 26th of October, 2012. – Janne Pikkarainen Oct 26 '11 at 12:38
  • Change "gateway" to "stargate" and you get some really neat traffic from a sniffer. – Bart Silverstrim Oct 26 '11 at 12:49