Link to home
Start Free TrialLog in
Avatar of clintonm9
clintonm9

asked on

Sendmail IP address

Okay here is the problem. We are using sendmail on Redhat 9.

When sendmail sends a message the header it says,

From clinton@domain.com Mon Sep 13 14:11:48 2004
Received: from server1.domain.com ([102.13.21.129])

Now if I dig server1.domain.com it comes back 102.13.20.133 not 102.13.21.129

But for some reason when sendmail sends the mail out it uses our ip we have set on ifcfg-eth1:3 (the last ip set)

How does sendmail get 102.13.21.129? Is there anyway to tell it to use 102.13.20.133 ??

Ips and names are changed!
Avatar of jlevie
jlevie

On this system does 'hostname' return server1.domain.com? And does /etc/hosts contain:

127.0.0.1           localhost.localdomain localhost
102.13.20.133  server1.domain.com server1
Oh yeah... What does a reverse lookup on the IP assigned to each interface and ip-alias show?
Avatar of clintonm9

ASKER

host file shows

102.13.20.133           server1.domain.com

i can add server 1 to the end, but i dont thinkt hat will fix it.

reverse point to the correct ip and vis-versa
What about the other IP's assigned to the box?
What about them, i dont know what you need?
What I'm trying to determine is what each IP assinged to the machine has as a hostname in DNS or the hosts file. My suspicion is that there may not be a one-to-one correspondence between host name and IP and Sendmail is getting confused as to what the hostname/IP relationship is. In the general case there should be exactly one IP associated with a hostname and vice versa. Aliases for a host should be handled with CNAME records.
I do not think each IP has a hostname assigned to it. There is about 50 ips on this machine. But the hostname is server1.domain.com and there is an entry in the hosts file plus the same in DNS. The hostname has an 'A' name not CNAME.
It is good to keep in mind that Sendmail is desgined to be RFC compliant and to operate in and RFC compliant environment. That in turn implies that each IP on the machine is associated with a unique hostname and that there are the appropriate A & PTR records or appropriate hosts file records.

The only reason one would have multiple IP's assigned to a system would be to host multiple servers, and that usually implies having a hostname associated with each IP. And as noted above the correct hostname data. Is that true in this case?

The other way that this could happen is if the network config isn't quite correct. There should only be one network config file with a GATEWAY definition. That file should be either /etc/sysconfig/network or, in the case where multiple NIC's are being used and eth0 doesn't connect to the default gateway, in the appropriate /etc/sysconfig/network-scripts/ifcfg-eth? file. If there are multiple GATEWAY definitions the default route will use the IP of the last interface (with a GATEWAY definition) configured as the source IP for outgoing connections.
The reason we have multiple IPs is b/c we have ssl cert.

And for some reason it is using that ip address in the header of the outgoing email.

cat ifcfg-eth1
ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes


cat ifcfg-eth1:0
DEVICE=eth1:0
BOOTPROTO=static
IPADDR=102.13.20.158
NETMASK=255.255.255.224
GATEWAY=102.13.20.129
ONBOOT=yes

cat ifcfg-eth1-range0
IPADDR_START=102.13.20.133
IPADDR_END=102.13.20.150
GATEWAY=102.13.20.129
CLONENUM_START=1
NETMASK=255.255.255.224

cat ifcfg-eth1-range1
IPADDR_START=102.13.21.129
IPADDR_END=102.13.21.158
GATEWAY=102.13.20.129
CLONENUM_START=30
NETMASK=255.255.255.224

For some reason the outgoing is picking up 102.13.21.129

Changed the first two octexs
Well, that's certainly a mess. Okay you have ip's of 102.13.20.133-150, 102.13.20.158, and 102.13.21.129-158 with a gateway of 102.13.20.129. Which makes no sense given a netmask of 255.255.255.224. The 102.13.21.129-158 block isn't in the same network as the router. So if the router is configured properly (with the same netmask) it shouldn't accept traffic from IP's in the range 102.13.21.129-158.  The netmask could be bigger, say a /23 or larger and all of the IPs would be usable. If I assume that's the case, that only eth1 is being used, and that the primary IP is supposed to be  102.13.20.133 the config ought to look like:

ifcfg-eth1:

DEVICE=eth1
BOOTPROTO=static
IPADDR=102.13.20.133
NETWORK=102.13.20.0
NETMASK=255.255.254.0
BROADCAST=102.13.21.255
GATEWAY=10.13.20.129

ifcfg-eth1:0:

BOOTPROTO=static
IPADDR=102.13.20.158
NETWORK=102.13.20.0
NETMASK=255.255.254.0
BROADCAST=102.13.21.255

ifcfg-eth1-range0:

BOOTPROTO=static
IPADDR=102.13.20.134
IPADDR_END=102.13.20.150
NETWORK=102.13.20.0
NETMASK=255.255.254.0
BROADCAST=102.13.21.255
CLONENUM_START=1

ifcfg-eth1-range1:

BOOTPROTO=static
IPADDR=102.13.20.129
IPADDR_END=102.13.20.158
NETWORK=102.13.20.0
NETMASK=255.255.254.0
BROADCAST=102.13.21.255
CLONENUM_START=17

when you write BROADCAST=10.13.21.255 is that suppose to be BROADCAST=102.13.21.255??

Also can you explain to me how you get that the BROADCAST is 102.13.21.255?

How can you change the netmask to 255.255.224.0, when my subnet is 255.255.255.224, or is there a differents?

On range1 it is suppose to be 102.13.21.129-102.13.21.158 not 102.13.20.134-102.13.20.150.
>  when you write BROADCAST=10.13.21.255 is that suppose to be BROADCAST=102.13.21.255??

Yes, my mistake. And likewise on range 1. I edited the comment to correct that.

>Also can you explain to me how you get that the BROADCAST is 102.13.21.255

The broadcast address is the last IP in a netblock. What that IP is is a function of the start of the netblock and the size of the mask.

> How can you change the netmask to 255.255.224.0, when my subnet is 255.255.255.224

Your subnet mask can't be 255.255.255.224 and have the subnets 102.13.20.128/32 & 102.13.21.128/32 on the same interface. So I'm assuming that the network attached to eth1 is actually using a a larger subnet that can contain both of those ranges. This is something that you should take up with the Network Admins and get the correct data.
Why cant the subnet for 102.13.20.128/32 be 255.255.255.224 and the subnet for 102.13.21.128/32 be 255.255.255.224? To differnet subnets for each range?
It can, but one wouldn't normally find that situation on a single network segment. That's why I suggested that you check with the Network Admins to verify the netmask.
I did, and they said it is correct. They said it is two different ranges
ASKER CERTIFIED SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial