Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Have a 'new' mailserver running postfix on Ubuntu.

We are having some problems configuring the subnets & interfaces.

Basically 2 subnets (.253. & .254.) need to be connected through the 3rd subnet (.252.) where the Router is residing.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        # dns-* options are implemented by the resolvconf package, if installed
        dns-search ***.com

auto eth1
iface eth1 inet static
        dns-search ***.com

auto eth2
iface eth2 inet static
        dns-search ***.com

I have an external support company who are looking into this (they built and configured this server), but it's taking far too long... So I'm looking to highlight the mistake!

Network Diagram

share|improve this question
I don't understand this configuration. You have a 16-bit subnet, yet at the same time you have three networks (.252, .253 and .254). With a 16-bit subnet, your network would range between -, putting said networks the same subnet. Thus you only have one network here - with 65534 possible hosts. If you want more networks, you have to do proper subnetting. – Sandokan Dec 3 '12 at 10:38
We don't need more networks, just the routing with this configuration. Or is that why it's not working? Are you saying it'd work with these 3 subnets and a netmask? – HaydnWVN Dec 3 '12 at 10:45
I'm saying you are having two mutually exclusive entries in your configuration. On one part you are using 16-bit netmask and at the same time you are trying to use three network ID's. The thing is, those ID's are invalid since you only have one valid ID - - ergo one large network. I'm not really sure where how you ended up with this configuration since I don't know your infrastructure. – Sandokan Dec 3 '12 at 10:53
The configuration is very similar to our old configuration which isn't on Ubuntu and seems to be working? How should the netmasks be set for the 3 subnets? – HaydnWVN Dec 3 '12 at 10:58
Depends entirely on how many hosts you need now (and in the near future). You can use as a quick aid. A network like yours needs to be planned with detailed sketches. – Sandokan Dec 3 '12 at 11:03

The most likely scenario here is that the subnet masks are incorrect, and should be 24 bit masks:

As the configuration stands right now, the server believes there is a single network - This means that it may use any of its interfaces to talk to any of the machines on 10.62.252, 10.62.253 or 10.62.254 - not necessarily the one with a matching IP address. This is because it thinks it can get to all of these networks through the first interface that gets activated (which can be different each boot).

If this server is replacing another server that was acting as a gateway for the three subnets, you need to:

  1. Change the subnet masks to
  2. Enable ip routing in /etc/sysctl.conf by uncommenting (or making sure it is set) net.ipv4.ip_forward=1

If the subnets are right, as in they match the subnet masks used on other devices, then we would also need to look at layer 2. Traditionally, when you subnet, you also VLAN, which is to configure sets of ports on the switches to only communicate with each other. This means that you have to make sure that the mail server is in the right ports on the switch, or confirm that the ports it is plugged into are in the correct vlans.

share|improve this answer
Great info and explanation (which Sandokan hinted towards in comments). Am working through this now and will let you know the outcome! – HaydnWVN Dec 3 '12 at 13:15
I'm still getting Desination host unreachable after these changes when trying to ping local machines... – HaydnWVN Dec 3 '12 at 14:17
Default route needs to be set according to each subnet. Do you have a diagram of your network config you put on here? – Matt Dec 3 '12 at 23:38
I don't have a diagram I can (or want to) upload. Could you supply some information on how to set the routing for each subnet/interface? – HaydnWVN Dec 4 '12 at 12:50
@HaydnWVN Given this is the router for everything else, it is unlikely to be a routing issue - all three networks are direct connected. If you are pinging something on the local network from the mailserver and it is not getting through, then it is likely the VLANs are not right. – Paul Dec 4 '12 at 13:17

Your Answer


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.