Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Greg Sims
We have a KVM running Postfix on CentOS 8.  The VM does not have access to IPV6 (something I hope to fix in the future).  Here is "ip addr" for the public interface of the VM (the ip/mac addresses has been obscured).

3: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 108.168.xxx.xxx/29 brd 108.168.xxx.xxx scope global noprefixroute ens4
       valid_lft forever preferred_lft forever

Note that ipv6 is disabled for this network interface.

I set "inet_protocol = ipv4" in main.cf.

I am able to relay email with this configuration but I see the following in the maillog:

  warning: smtp_connect_addr: bind 75.126.xxx.xxx: Cannot assign requested address

Please note 75.126.xxx.xxx is one of the addresses I am using to perform the relay based on:

  "sender_dependent_default_transport_maps = randmap:{r104,r105,r106,r107,r108,r109,r110,r111}" in main.cf

I believe this warning in maillog indicates a request to deliver email on ipv6 which is not available.  A retry takes place on ipv4 as a result -- which is successful.

I understand this is a warning, but it will fill up a great deal of maillog space over time.  Is there some way to eliminate this maillog entry (and perhaps the retry) -- without configuring ipv6?

Thanks, Greg
Reply | Threaded
Open this post in threaded view
|

Re: Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Wietse Venema
Greg Sims:
>   warning: smtp_connect_addr: bind 75.126.xxx.xxx: Cannot assign requested
> address

You have a smtp_bind_address setting in main.cf or master.cf.  That
setting dopes not work, because the IP address is not a local
interface. Remove the setting.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Greg Sims
My goal is to use eight ip addresses to relay email from the server.  I have the following in main.cf to randomize the use of ip addresses:

  sender_dependent_default_transport_maps = randmap:{r104,r105,r106,r107,r108,r109,r110,r111}

For each of the transports in the randmap list, I have an entry in master.cf as follows:

  r104     unix  -       -       n       -       -       smtp
    -o smtp_bind_address=75.126.xxx.xxx
    -o smtp_helo_name=r104.raystedman.org
    -o syslog_name=r104

I believe this creates the mapping between transports and ip addresses.  If I delete "-o smtp_bind_address=75.126.xxx.xxx", Postfix will not know that I want to use a specific ip address for the r104 transport.   

I did notice that the 75.126.xxx.xxx addresses are not known to an interface on the VM.  I added these addresses as secondary ip addresses to ens4 which is the public interface on the VM. Now we have ens4:1, ens4:2,..., ens4:8.  Unfortunately, this did not eliminate the warning messages in the maillog.

Now the question becomes, how can I use randmap for a set of transports/ip addresses without "warning: smtp_connect_addr: bind 75.126.xxx.xxx: Cannot assign requested address" messages in the maillog. It is interesting to note that the relay to random ip addresses works well -- just the message in maillog is the problem.

Thanks again! Greg

On Thu, Jun 25, 2020 at 12:24 PM Wietse Venema <[hidden email]> wrote:
Greg Sims:
>   warning: smtp_connect_addr: bind 75.126.xxx.xxx: Cannot assign requested
> address

You have a smtp_bind_address setting in main.cf or master.cf.  That
setting dopes not work, because the IP address is not a local
interface. Remove the setting.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Wietse Venema
Greg Sims:
> I did notice that the 75.126.xxx.xxx addresses are not known to an
> interface on the VM.  I added these addresses as secondary ip addresses to
> ens4 which is the public interface on the VM. Now we have ens4:1,
> ens4:2,..., ens4:8.  Unfortunately, this did not eliminate the warning
> messages in the maillog.

Helpfully, you did not show any evidence that the addresses are
added, so I have to assume that you made a mistake.

You must add these addresses to a LOCAL interface, other
smtp_bind_address cannot work. Period.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Greg Sims
I am sorry Wietse.  I needed to change my ip addresses as I exposed the previous set above.  The following uses the new ip address set.  The transports are now named  r192, r193, ... r199 in the same pattern you see above.

ens4 is the local public network interface of the VM.  It has one primary ip: 108.xxx.xxx.45 and eight secondary ip addresses: 74.xxx.xxx.19x.  Here is the ens4 section of "ip addr" on the VM.

  3: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:00:c3:58:df brd ff:ff:ff:ff:ff:ff
    inet 108.xxx.xxx.45/29 brd 108.xxx.xxx.47 scope global noprefixroute ens4
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.192/29 brd 74.xxx.xxx.199 scope global noprefixroute ens4:1
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.193/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:2
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.194/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:3
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.195/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:4
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.196/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:5
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.197/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:6
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.198/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:7
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.199/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:8
       valid_lft forever preferred_lft forever

I did notice 74.xxx.xxx.192 does not have the keyword "secondary" above -- the network-script that created ens4:1 is the same as all the other seven secondaries.

  [rsm@rhel8 network-scripts]$ cat ifcfg-ens4:1
  DEVICE="ens4:1"
  Type="Ethernet"
  ONBOOT="yes"
  NM_CONTROLLED="no"  
  BOOTPROTO="none"
  IPADDR="74.xxx.xxx.192"
  PREFIX="29"

Thanks, Greg

On Thu, Jun 25, 2020 at 5:29 PM Wietse Venema <[hidden email]> wrote:
Greg Sims:
> I did notice that the 75.126.xxx.xxx addresses are not known to an
> interface on the VM.  I added these addresses as secondary ip addresses to
> ens4 which is the public interface on the VM. Now we have ens4:1,
> ens4:2,..., ens4:8.  Unfortunately, this did not eliminate the warning
> messages in the maillog.

Helpfully, you did not show any evidence that the addresses are
added, so I have to assume that you made a mistake.

You must add these addresses to a LOCAL interface, other
smtp_bind_address cannot work. Period.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Matus UHLAR - fantomas
On 25.06.20 18:36, Greg Sims wrote:
>I am sorry Wietse.  I needed to change my ip addresses as I exposed the
>previous set above.  The following uses the new ip address set.  The
>transports are now named  r192, r193, ... r199 in the same pattern you see
>above.
>
>ens4 is the local public network interface of the VM.  It has one primary
>ip: 108.xxx.xxx.45 and eight secondary ip addresses: 74.xxx.xxx.19x.  Here
>is the ens4 section of "ip addr" on the VM.

I wonder why did you have error about 75.126.xxx.xxx when the addresses are
74.xxx.xxx.19x -  75 is not 74 ...

>  3: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state
>UP group default qlen 1000
>    link/ether 52:54:00:c3:58:df brd ff:ff:ff:ff:ff:ff
>    inet 108.xxx.xxx.45/29 brd 108.xxx.xxx.47 scope global noprefixroute
>ens4
>       valid_lft forever preferred_lft forever
>    inet 74.xxx.xxx.192/29 brd 74.xxx.xxx.199 scope global noprefixroute
>ens4:1
>       valid_lft forever preferred_lft forever
>    inet 74.xxx.xxx.193/29 brd 74.xxx.xxx.199 scope global secondary
>noprefixroute ens4:2
>       valid_lft forever preferred_lft forever
>    inet 74.xxx.xxx.194/29 brd 74.xxx.xxx.199 scope global secondary
>noprefixroute ens4:3
>       valid_lft forever preferred_lft forever
>    inet 74.xxx.xxx.195/29 brd 74.xxx.xxx.199 scope global secondary
>noprefixroute ens4:4
>       valid_lft forever preferred_lft forever
>    inet 74.xxx.xxx.196/29 brd 74.xxx.xxx.199 scope global secondary
>noprefixroute ens4:5
>       valid_lft forever preferred_lft forever
>    inet 74.xxx.xxx.197/29 brd 74.xxx.xxx.199 scope global secondary
>noprefixroute ens4:6
>       valid_lft forever preferred_lft forever
>    inet 74.xxx.xxx.198/29 brd 74.xxx.xxx.199 scope global secondary
>noprefixroute ens4:7
>       valid_lft forever preferred_lft forever
>    inet 74.xxx.xxx.199/29 brd 74.xxx.xxx.199 scope global secondary
>noprefixroute ens4:8
>       valid_lft forever preferred_lft forever
>
>I did notice 74.xxx.xxx.192 does not have the keyword "secondary" above --
>the network-script that created ens4:1 is the same as all the other seven
>secondaries.

--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Enter any 12-digit prime number to continue.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Wietse Venema
In reply to this post by Greg Sims
Greg Sims:
>     inet 74.xxx.xxx.192/29 brd 74.xxx.xxx.199 scope global noprefixroute
> ens4:1

Helpfully, you did not provide the error message with the CURRENT
configuration.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Greg Sims
Good Morning Wietse,

The error message is the same in this configuration with ens4 NM_CONTROLLED="no" using Alias ip addresses:

rhel8 r193/smtp[4988]: warning: smtp_connect_addr: bind 75.xxx.xxx.193: Cannot assign requested address

Email is being relayed properly.

I can configured the VM with ens4 NM_CONTROLLED="yes" using Secondary ip addresses.  I can gather data for this configuration of the VM if you wish.

Thanks, Greg

On Fri, Jun 26, 2020 at 5:49 AM Wietse Venema <[hidden email]> wrote:
Greg Sims:
>     inet 74.xxx.xxx.192/29 brd 74.xxx.xxx.199 scope global noprefixroute
> ens4:1

Helpfully, you did not provide the error message with the CURRENT
configuration.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Wietse Venema
Greg Sims:
> Good Morning Wietse,
>
> The error message is the same in this configuration with ens4
> NM_CONTROLLED="no" using Alias ip addresses:
>
> rhel8 r193/smtp[4988]: warning: smtp_connect_addr: bind 75.xxx.xxx.193:
> Cannot assign requested address

You claim that you configured the following as additonal interface
addresses:

        74.something

The error message shows that you configured Postfix to bind to:

        75.something

Do you notice the difference?

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Greg Sims
>>> I had to change ip addresses in the middle of this issue -- as I mentioned above. <<<

Here is data from the current VM configuration.

ip addr
=====
  3: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 108.xxx.xxx.45/29 brd 108.xxx.xxx.47 scope global noprefixroute ens4
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.192/29 brd 74.xxx.xxx.199 scope global noprefixroute ens4:1
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.193/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:2
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.194/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:3
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.195/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:4
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.196/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:5
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.197/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:6
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.198/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:7
       valid_lft forever preferred_lft forever
    inet 74.xxx.xxx.199/29 brd 74.xxx.xxx.199 scope global secondary noprefixroute ens4:8
       valid_lft forever preferred_lft forever

=====

  # mail is sent from one of several relays which is selected at random
  sender_dependent_default_transport_maps = randmap:{r192,r193,r194,r195,r196,r197,r198,r199}

=======

  r192     unix  -       -       n       -       -       smtp
    -o smtp_bind_address=75.xxx.xxx.192
    -o smtp_helo_name=r192.raystedman.org
    -o syslog_name=r192

  repeated for r192, r194, ..., r199

maillog
======

  r193/smtp[4988]: warning: smtp_connect_addr: bind 75.xxx.xxx.193: Cannot assign requested address

This is all data from the current VM.  This is all consistent using the 75.xxx.xxx.xxx set of ip addresses.

Thanks, Greg

On Fri, Jun 26, 2020 at 7:40 AM Wietse Venema <[hidden email]> wrote:
Greg Sims:
> Good Morning Wietse,
>
> The error message is the same in this configuration with ens4
> NM_CONTROLLED="no" using Alias ip addresses:
>
> rhel8 r193/smtp[4988]: warning: smtp_connect_addr: bind 75.xxx.xxx.193:
> Cannot assign requested address

You claim that you configured the following as additonal interface
addresses:

        74.something

The error message shows that you configured Postfix to bind to:

        75.something

Do you notice the difference?

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Pau Amma
As was repeatedly pointed out to you, 74 is not the same as 75.

On 2020-06-26 16:56, Greg Sims wrote:

> ip addr
> =====
>   3: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel
> state
> UP group default qlen 1000
>     link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
>     inet 108.xxx.xxx.45/29 brd 108.xxx.xxx.47 scope global
> noprefixroute
> ens4
>        valid_lft forever preferred_lft forever
>     inet 74.xxx.xxx.192/29 brd 74.xxx.xxx.199 scope global
> noprefixroute

You have 74 (seventy *four*) here

[snip]

> master.cf
> =======
>
>   r192     unix  -       -       n       -       -       smtp
>     -o smtp_bind_address=75.xxx.xxx.192

You have 75 (seventy *five*) here.

Either use 74 everywhere, or use 75 everywhere.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Greg Sims
Wietse & Pau,

Thank you for pointing out my configuration error.  This was a struggle for me and I appreciate your patience.

I corrected the configuration error and retested two configurations for the VM:

  (1) relay addresses as aliases
  (2) relay addresses as secondaries

In both configurations of the VM, the error message did not occur in maillog.  This issue is resolved as a configuration error by the user.
  
Thanks again!! Greg

On Fri, Jun 26, 2020 at 8:09 AM Pau Amma <[hidden email]> wrote:
As was repeatedly pointed out to you, 74 is not the same as 75.

On 2020-06-26 16:56, Greg Sims wrote:
> ip addr
> =====
>   3: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel
> state
> UP group default qlen 1000
>     link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
>     inet 108.xxx.xxx.45/29 brd 108.xxx.xxx.47 scope global
> noprefixroute
> ens4
>        valid_lft forever preferred_lft forever
>     inet 74.xxx.xxx.192/29 brd 74.xxx.xxx.199 scope global
> noprefixroute

You have 74 (seventy *four*) here

[snip]

> master.cf
> =======
>
>   r192     unix  -       -       n       -       -       smtp
>     -o smtp_bind_address=75.xxx.xxx.192

You have 75 (seventy *five*) here.

Either use 74 everywhere, or use 75 everywhere.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

Wietse Venema
In reply to this post by Greg Sims
>     inet 74.xxx.xxx.192/29 brd 74.xxx.xxx.199 scope global noprefixroute
>     inet 74.xxx.xxx.193/29 brd 74.xxx.xxx.199 scope global secondary
>     inet 74.xxx.xxx.194/29 brd 74.xxx.xxx.199 scope global secondary
>     inet 74.xxx.xxx.195/29 brd 74.xxx.xxx.199 scope global secondary
>     inet 74.xxx.xxx.196/29 brd 74.xxx.xxx.199 scope global secondary
>     inet 74.xxx.xxx.197/29 brd 74.xxx.xxx.199 scope global secondary
>     inet 74.xxx.xxx.198/29 brd 74.xxx.xxx.199 scope global secondary
>     inet 74.xxx.xxx.199/29 brd 74.xxx.xxx.199 scope global secondary

Your network configuration is 74.something.

>   r193/smtp[4988]: warning: smtp_connect_addr: bind 75.xxx.xxx.193: Cannot
> assign requested address

Your Postfix configuration is 75.something.

They shold match.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Cannot assign requested address -- with "inet_protocol = ipv4" in main.cf

A. Schulze
In reply to this post by Greg Sims


Am 25.06.20 um 20:58 schrieb Greg Sims:
> I set "inet_protocol = ipv4" in main.cf <http://main.cf>.

postconf inet_protocol
postconf: warning: inet_protocol: unknown parameter

postconf inet_protocols
<probably not only ipv4> ?

Andreas