The officially official Devuan Forum!

You are not logged in.

#1 2023-01-12 18:08:55

bai4Iej2need
Member
From: Ortenau
Registered: 2021-04-25
Posts: 117  

[SOLVED] postfix dynamic ipv6 interfaces

I have succeded with installing propagation of Ipv6 subnet numbers.

/etc/postfix/main.cf:
    inet_interfaces = all
    inet_interfaces = all (DEFAULT)
    inet_interfaces = 127.0.0.1
    inet_interfaces = 127.0.0.1, [::1] (Postfix version 2.2 and later)
    inet_interfaces = 192.168.1.2, 127.0.0.1
    inet_interfaces = localhost

Postfix shall listen on eth1,(LAN) but not on eth0 (World).

what is missing here:

 inet_interfaces = eth0 
 inet_interfaces = eth1

with ipv6 I do not have fixed ip numbers, because these will change dynamically

Starting Postfix Mail Transport Agent: postfixpostmulti: fatal: config variable inet_interfaces: host not found: eth1

The ipv6 numbers will change dynamically , what ever I receive from my ISP .
They (dhcpv6) might last 3 months or 1 hour. Both I had already.

How do I have postfix bind to an interface such as eth1 without mentioning the ipv6 numbers ?

Last edited by bai4Iej2need (2023-01-12 18:16:46)


The devil, you know, is better than the angel, you don't know. by a British Citizen, I don't know too good.
One generation abandons the enterprises of another like stranded vessels. By Henry David Thoreau, WALDEN, Economy. Line 236 (Gutenberg text Version)
broken by design :
https://bugs.debian.org/cgi-bin/bugrepo … bug=958390

Offline

#2 2023-01-13 01:46:20

rbit
Member
Registered: 2018-06-12
Posts: 46  

Re: [SOLVED] postfix dynamic ipv6 interfaces

bai4Iej2need wrote:

Postfix shall listen on eth1,(LAN) but not on eth0 (World).

bai4Iej2need wrote:

with ipv6 I do not have fixed ip numbers, because these will change dynamically
The ipv6 numbers will change dynamically , what ever I receive from my ISP .

These statements appear to be contrary to each other.  Do you want postfix for local network only, or for world (internet)?  If you only need it for LAN, then it does not matter what your ISP assigns; just set up a static local address to use on eth1.
If you actually do want it to be reachable from outside your network (internet), then is there any reason not to use inet_interfaces = all?

Last edited by rbit (2023-01-13 01:47:00)

Offline

#3 2023-01-13 15:32:55

bai4Iej2need
Member
From: Ortenau
Registered: 2021-04-25
Posts: 117  

Re: [SOLVED] postfix dynamic ipv6 interfaces

These statements appear to be contrary to each other.

No contradiction within
the ISP provides a prefix range /56 or /64, of which a portion is assigned through propagation into the subnets behind.
e.g. when I unplug the WWW router and reconnect it, my subnet has new ipv6 numbers.

I still want postfix to listen only on the LAN and localhost for local messages. So postfix must know the actual IPv6 numbers of the LAN interface

netstat -tulpen | egrep "master|PID" 
Proto Recv-Q Send-Q Local Address           Foreign Address         State       Benutzer   Inode      PID/Program name    
tcp        0      0 127.0.0.1:465           0.0.0.0:*               LISTEN      0          6565139    20047/master        
tcp6       0      0 ::1:465                 :::*                    LISTEN      0          6565140    20047/master  

on Ipv4 postfix listens only locally, on ipv6 postfix listens on all interfaces.
anyone knowing the ipv6 address may try to use postmaster (fortunately behind a router blocking the port)


The devil, you know, is better than the angel, you don't know. by a British Citizen, I don't know too good.
One generation abandons the enterprises of another like stranded vessels. By Henry David Thoreau, WALDEN, Economy. Line 236 (Gutenberg text Version)
broken by design :
https://bugs.debian.org/cgi-bin/bugrepo … bug=958390

Offline

#4 2023-01-13 17:58:37

rbit
Member
Registered: 2018-06-12
Posts: 46  

Re: [SOLVED] postfix dynamic ipv6 interfaces

I'm still not understanding something here.
Do you have two NICs (eth0 and eth1)?
If eth1 = LAN as posted earlier, then set up a static IPv6 network there.  https://en.wikipedia.org/wiki/Reserved_IP_addresses use one of the "Private internets" ranges (64:ff9b:1::/48 for example).  eth0 will receive whatever address is assigned when connecting to ISP.  In your postfix conf, use the static address that you've chosen for eth1.
(Note, I don't actually use IPv6, maybe someone with experience with this can chime in.)

You can do the same thing even if you only have one physical device, with a virtual interface (for example, ifconfig eth0:1 64:ff9b:1::1).  I do this with IPv4 addresses and postfix.

AFAIK, there's currently no other way to configure postfix for dynamic IP addresses, except for inet_interfaces = all.  I could be wrong there, but from skimming through http://www.postfix.org/postconf.5.html I'm not seeing it.

Last edited by rbit (2023-01-13 18:10:01)

Offline

#5 2023-01-14 16:46:43

bai4Iej2need
Member
From: Ortenau
Registered: 2021-04-25
Posts: 117  

Re: [SOLVED] postfix dynamic ipv6 interfaces

Do you have two NICs (eth0 and eth1)?

Yes

use one of the "Private internets" ranges

I take this as a solution, and will remove the portion which propagates the ipv6 range to the subnet
I felt, this was necessary, but is not in view of the existence of private subnets

I used this advice
https://subnettingpractice.com/how-to-subnet-ipv6.html

BTW the idea of having private ipv6 subnets is cool and contrary to the original Idea of worldwide ipv6 numbers.

Thank you

Last edited by bai4Iej2need (2023-01-14 16:49:07)


The devil, you know, is better than the angel, you don't know. by a British Citizen, I don't know too good.
One generation abandons the enterprises of another like stranded vessels. By Henry David Thoreau, WALDEN, Economy. Line 236 (Gutenberg text Version)
broken by design :
https://bugs.debian.org/cgi-bin/bugrepo … bug=958390

Offline

Board footer