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

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
        address 10.62.254.199
        netmask 255.255.0.0
        network 10.62.254.0
        broadcast 10.62.255.255
        #gateway 10.62.252.138
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 10.62.252.138
        dns-search ***.com

auto eth1
iface eth1 inet static
        address 10.62.253.199
        netmask 255.255.0.0
        network 10.62.253.0
        broadcast 10.62.255.255
        #gateway 10.62.252.138
        #dns-nameservers 10.62.254.199 10.62.253.199 10.62.252.199
        dns-nameservers 10.62.252.138
        dns-search ***.com


auto eth2
iface eth2 inet static
        address 10.62.252.199
        netmask 255.255.0.0
        network 10.62.252.0
        broadcast 10.62.255.255
        gateway 10.62.252.138
        #dns-nameservers 10.62.254.199 10.62.253.199 10.62.252.199
        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
3  
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 10.62.0.0 - 10.62.255.255, putting said networks the same subnet. Thus you only have one network here - 10.62.0.0 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 255.255.255.0 netmask? –  HaydnWVN Dec 3 '12 at 10:45
1  
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 - 10.62.0.0 - 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 subnet-calculator.com as a quick aid. A network like yours needs to be planned with detailed sketches. –  Sandokan Dec 3 '12 at 11:03

1 Answer 1

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

As the configuration stands right now, the server believes there is a single network - 10.62.0.0/16. 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 255.255.255.0
  2. Enable ip routing in /etc/sysctl.conf by uncommenting (or making sure it is set) net.ipv4.ip_forward=1

If the 255.255.255.0 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

 
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.