Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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....

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Is this an actual typo in your config?

    gateaway 192.168.2.46

Should be

    gateway 192.168.2.46
share|improve this answer
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.