Solved

Sendmail IP address

Posted on 2004-09-14
16
233 Views
Last Modified: 2010-04-20
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!
0
Comment
Question by:clintonm9
  • 9
  • 7
16 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 12058673
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
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12058712
Oh yeah... What does a reverse lookup on the IP assigned to each interface and ip-alias show?
0
 

Author Comment

by:clintonm9
ID: 12059051
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
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12059879
What about the other IP's assigned to the box?
0
 

Author Comment

by:clintonm9
ID: 12064550
What about them, i dont know what you need?
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12066916
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.
0
 

Author Comment

by:clintonm9
ID: 12067568
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.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12068049
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.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:clintonm9
ID: 12069380
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
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12071240
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

0
 

Author Comment

by:clintonm9
ID: 12074559
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.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12074801
>  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.
0
 

Author Comment

by:clintonm9
ID: 12075119
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?
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12075748
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.
0
 

Author Comment

by:clintonm9
ID: 12076175
I did, and they said it is correct. They said it is two different ranges
0
 
LVL 40

Accepted Solution

by:
jlevie earned 250 total points
ID: 12076370
Okay... Then the config should look like:

ifcfg-eth1:

DEVICE=eth1
BOOTPROTO=static
IPADDR=102.13.20.133
NETWORK=102.13.20.128
NETMASK=255.255.255.224
BROADCAST=102.13.20.159
GATEWAY=10.13.20.129

ifcfg-eth1:0:

BOOTPROTO=static
IPADDR=102.13.20.158
NETWORK=102.13.20.128
NETMASK=255.255.255.224
BROADCAST=102.13.20.159

ifcfg-eth1-range0:

BOOTPROTO=static
IPADDR=102.13.20.134
IPADDR_END=102.13.20.150
NETWORK=102.13.20.128
NETMASK=255.255.255.224
BROADCAST=102.13.20.159
CLONENUM_START=1

ifcfg-eth1-range1:

BOOTPROTO=static
IPADDR=102.13.21.129
IPADDR_END=102.13.21.158
NETWORK=102.13.21.128
NETMASK=255.255.255.224
BROADCAST=102.13.21.159
CLONENUM_START=17
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now