[SOLVED] ipv6 nachträglich konfigurieren

Feb 17, 2022
12
3
3
59
Hallo,

was muss ich tun, um ipv6 nachträglich zu aktivieren?

In der /etc/network/interfaces ist ipv6 konfiguriert und aktiv.

Ein pmgconfig dump hat dann nur die ipv4 Adresse:

postfix.int_ip = 1.2.3.4
ipconfig.int_ip = 1.2.3.4

Wie kann ich diese Variablen ändern?

Gruß

Knuut
 
a) funktioniert etwas mit der config so wie sie jetzt ist nicht (wie erwartet)? - falls das so ist bitte kurz beschreiben und zugehörige logs posten.
b) die int_ip variable wird basierend auf den DNS informationen zum hostname geholt - sprich - wenn da die IPv6 sein soll -> /etc/hosts anpassen
aber wie gesagt - derzeit glaube ich dass das eher ein kosmetisches Thema ist

Ich hoffe das hilft!
 
Mit der config funktioniert alles mit ipv4. Allerdings möchten wir gerne auch zusätzlich per ipv6 erreichbar sein.

Die /etc/hosts habe ich angepasst mit der zusätzlichen ipv6 Adresse:

Code:
1.2.3.4 pmg.domain.tld pmg
1111:2222:3333:4444::1 pmg.domain.tld pmg

Im DNS ist auch ein AAAA record hinterlegt.

Nach einem reboot waren keine Änderung der Variablen zu erkennen.

ping6 auf hostname und fqdn funktionieren.

Was können wir noch tun?
 
Bleibt die Frage: Funktioniert der Versand über IPv6? - Ich würde es annehmen (und bei einem ähnlichen Setup hier ist das auch so)
lässt sich (außer sich eine mail von einem Provider der IPv6 verwendet (z.B. gmail) zu schicken)) mit swaks ueberpruefen (kann auf den meisten Linux systemen über den package manager installieren lassen)

` swaks --server [1111:2222:3333:4444::1] --to adresse@domain.example --quit-after RCPT`

Ich hoffe das hilft
 
Mit swaks funktioniert der smtp-Dialog einwandfrei. Der Versand an einen ipv6 MX (google) funktioniert auch.

Nun möchten wir auch gerne noch per ipv6 erreichbar sein.

netstat -tlnp liefert auf Port 25 leider nur die ipv4 Adresse.

Gegenprobe mit telnet:

telnet -6 1111:2222:3333:4444::1 25 telnet: Unable to connect to remote host: Connection refused
 
Mit swaks funktioniert der smtp-Dialog einwandfrei. Der Versand an einen ipv6 MX (google) funktioniert auch.
* swaks muss von einem anderen system != PMG ausgeführt werden (um zu sehen ob es von außen erreichbar ist)
* die Idee war eine Mail _von_ einem IPv6 mailprovider (google) an eine Domain für die das PMG MX ist zu schicken

netstat -tlnp liefert auf Port 25 leider nur die ipv4 Adresse.
hmm - ist hier nicht der fall - wurden config-templates für postfix angepasst?
(/etc/pmg/templates/main.cf.in, /etc/pmg/templates/master.cf.in)?

wurde mal neugestartet nachdem ipv6 hinzugefügt wurde?

bitte auch vom PMG das output von `ss -tlnp` posten
 
hmm - ist hier nicht der fall - wurden config-templates für postfix angepasst?
(/etc/pmg/templates/main.cf.in, /etc/pmg/templates/master.cf.in)?

Ja, leider musste das sein, weil O365 sich nicht auf einen alternativen Port konfigurieren lässt. Mit einer zusätzlichen IPv4 auf pmg lässt sich das aber machen.

Das Template verwendet die Variable:

Code:
  -o mynetworks=127.0.0.0/8,[% postfix.int_ip %]

Wobei mir immer noch unklar ist, woher der Wert von % postfix.int_ip % gesetzt wurde.

Ein

Code:
postconf -d | grep "mynetworks "
mynetworks = 127.0.0.0/8 1.2.3.4/32 4.3.2.1/32 [::1]/128 [1111:2222:3333:4444::1]/128

ss -tlnp

Code:
State   Recv-Q  Send-Q  Local             Address:Port  Peer                                                                                                                                                                Address:PortProcess                                                                                                                                         
LISTEN  0       4096    127.0.0.1:10022   0.0.0.0:*     users:(("pmgpolicy                                                                                                                                                  child",pid=7182,fd=8),("pmgpolicy  child",pid=7181,fd=8),("pmgpolicy  child",pid=7180,fd=8),("pmgpolicy                   child",pid=7179,fd=8),("pmgpolicy  child",pid=7178,fd=8),("pmgpolicy",pid=3206,fd=8))
LISTEN  0       4096    127.0.0.1:10023   0.0.0.0:*     users:(("pmg-smtp-filter",pid=10534,fd=5),("pmg-smtp-filter",pid=9694,fd=5),("pmg-smtp-filter",pid=3300,fd=5))                                                                                                                                                                                                                   
LISTEN  0       4096    127.0.0.1:35623   0.0.0.0:*     users:(("urbackupclientb",pid=534,fd=9))                                                                                                                                                                                                                                                                                         
LISTEN  0       4096    127.0.0.1:10024   0.0.0.0:*     users:(("pmg-smtp-filter",pid=10534,fd=7),("pmg-smtp-filter",pid=9694,fd=7),("pmg-smtp-filter",pid=3300,fd=7))                                                                                                                                                                                                                   
LISTEN  0       100     127.0.0.1:10025   0.0.0.0:*     users:(("smtpd",pid=10182,fd=6),("master",pid=3073,fd=26))                                                                                                                                                                                                                                                                       
LISTEN  0       4096    0.0.0.0:111       0.0.0.0:*     users:(("rpcbind",pid=455,fd=4),("systemd",pid=1,fd=36))                                                                                                                                                                                                                                                                         
LISTEN  0       4096    127.0.0.1:85      0.0.0.0:*     users:(("pmgdaemon                                                                                                                                                  worke",pid=3451,fd=6),("pmgdaemon  worke",pid=3445,fd=6),("pmgdaemon  worke",pid=3444,fd=6),("pmgdaemon",pid=3439,fd=6))                                     
LISTEN  0       128     0.0.0.0:22        0.0.0.0:*     users:(("sshd",pid=540,fd=3))                                                                                                                                                                                                                                                                                                   
LISTEN  0       244     127.0.0.1:5432    0.0.0.0:*     users:(("postgres",pid=568,fd=5))                                                                                                                                                                                                                                                                                               
LISTEN  0       100     1.2.3.4:25  0.0.0.0:*     users:(("postscreen",pid=10164,fd=6),("master",pid=3073,fd=20))                                                                                                                                                                                                                                                                 
LISTEN  0       100     10.10.10.4:25     0.0.0.0:*     users:(("master",pid=3073,fd=17))                                                                                                                                                                                                                                                                                               
LISTEN  0       100     4.3.2.1:25  0.0.0.0:*     users:(("master",pid=3073,fd=13))                                                                                                                                                                                                                                                                                               
LISTEN  0       4096    0.0.0.0:10050     0.0.0.0:*     users:(("zabbix_agentd",pid=549,fd=4),("zabbix_agentd",pid=548,fd=4),("zabbix_agentd",pid=547,fd=4),("zabbix_agentd",pid=546,fd=4),("zabbix_agentd",pid=545,fd=4))                                                                                                                                                               
LISTEN  0       4096    *:8006            *:*           users:(("pmgproxy                                                                                                                                                   worker",pid=8475,fd=6),("pmgproxy  worker",pid=8371,fd=6),("pmgproxy  worker",pid=8319,fd=6),("pmgproxy",pid=3963,fd=6))                                     
LISTEN  0       4096    [::1]:35623       [::]:*        users:(("urbackupclientb",pid=534,fd=10))                                                                                                                                                                                                                                                                                       
LISTEN  0       4096    [::]:111          [::]:*        users:(("rpcbind",pid=455,fd=6),("systemd",pid=1,fd=38))                                                                                                                                                                                                                                                                         
LISTEN  0       128     [::]:22           [::]:*        users:(("sshd",pid=540,fd=4))                                                                                                                                                                                                                                                                                                   
LISTEN  0       4096    [::]:10050        [::]:*        users:(("zabbix_agentd",pid=549,fd=5),("zabbix_agentd",pid=548,fd=5),("zabbix_agentd",pid=547,fd=5),("zabbix_agentd",pid=546,fd=5),("
 
Ja, leider musste das sein, weil O365 sich nicht auf einen alternativen Port konfigurieren lässt. Mit einer zusätzlichen IPv4 auf pmg lässt sich das aber machen.

Das Template verwendet die Variable:
bitte mal beide angepassten templates hier sharen - dann wissen wir ob das der grund ist.
Wobei mir immer noch unklar ist, woher der Wert von % postfix.int_ip % gesetzt wurde.
wird eben über /etc/hosts (bzw. DNS info) geholt
 
master.cf.in
Code:
[% IF ! pmg.mail.before_queue_filtering -%]
scan      unix  -       -       n       -       [% pmg.mail.max_filters %]      lmtp
  -o lmtp_send_xforward_command=yes
  -o lmtp_connection_cache_on_demand=no
  -o disable_dns_lookups=yes
[% END -%]

4.3.2.1:25       inet  n -       -       -       [% pmg.mail.max_smtpd_out %]      smtpd
[% IF pmg.mail.before_queue_filtering -%]
  -o smtpd_proxy_filter=127.0.0.1:10023
  -o smtpd_proxy_options=speed_adjust
  -o smtpd_client_connection_count_limit=[% pmg.mail.conn_count_limit div 5 %]
[%- ELSE -%]
  -o content_filter=scan:127.0.0.1:10023
[%- END %]
  -o smtpd_recipient_restrictions=permit_mynetworks,reject_unauth_destination
  -o smtpd_helo_restrictions=
  -o smtpd_client_restrictions=
  -o smtpd_sender_restrictions=

10.10.10.4:25       inet  n -       -       -       [% pmg.mail.max_smtpd_out %]      smtpd
[% IF pmg.mail.before_queue_filtering -%]
  -o smtpd_proxy_filter=127.0.0.1:10023
  -o smtpd_proxy_options=speed_adjust
  -o smtpd_client_connection_count_limit=[% pmg.mail.conn_count_limit div 5 %]
[%- ELSE -%]
  -o content_filter=scan:127.0.0.1:10023
[%- END %]
  -o smtpd_recipient_restrictions=permit_mynetworks,reject_unauth_destination
  -o smtpd_helo_restrictions=
  -o smtpd_client_restrictions=
  -o smtpd_sender_restrictions=

1.2.3.4:25       inet  n -       -       -       1 postscreen

smtpd       pass  - -       -       -       [% pmg.mail.max_smtpd_in %]      smtpd
[% IF pmg.mail.before_queue_filtering -%]
  -o smtpd_proxy_filter=127.0.0.1:10024
  -o smtpd_proxy_options=speed_adjust
  -o smtpd_client_connection_count_limit=[% pmg.mail.conn_count_limit div 5 %]
[%- ELSE -%]
  -o content_filter=scan:127.0.0.1:10024
[%- END %]
  -o receive_override_options=no_address_mappings
  -o smtpd_discard_ehlo_keywords=silent-discard,dsn
  -o mynetworks=127.0.0.0/8,[% postfix.int_ip %]

127.0.0.1:10025 inet  n       -       n       -       -      smtpd
  -o content_filter=
  -o local_recipient_maps=
  -o relay_recipient_maps=
  -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
  -o smtpd_helo_restrictions=
  -o smtpd_client_restrictions=
  -o smtpd_restriction_classes=
  -o smtpd_sender_restrictions=
  -o smtpd_recipient_restrictions=permit_mynetworks,reject
  -o mynetworks=127.0.0.0/8
  -o smtpd_error_sleep_time=0
  -o smtpd_client_connection_count_limit=0
  -o smtpd_client_connection_rate_limit=0
  -o smtpd_tls_security_level=none
  -o smtpd_authorized_xforward_hosts=127.0.0.0/8
  -o message_size_limit=[% (pmg.mail.maxsize*2) %]

pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
  -o message_size_limit=[% (pmg.mail.maxsize*2) %]

qmgr      fifo  n       -       -       300     1       qmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
verify    unix  -       -       -       -       1       verify
trace     unix  -       -       n       -       0       bounce
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
discard   unix  -       -       -       -       -       discard
retry     unix  -       -       -       -       -       error
dnsblog   unix  -       -       -       -       0       dnsblog
tlsproxy  unix  -       -       -       -       0       tlsproxy

main.cf.in

Code:
# auto-generated by proxmox

compatibility_level = 2
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix/sbin
data_directory = /var/lib/postfix

# appending .domain is the MUA's job.
append_dot_mydomain = yes

smtpd_banner = $myhostname [% pmg.mail.banner %]
biff = no

[% IF pmg.mail.dwarning %]
delay_warning_time = [% pmg.mail.dwarning %]h
[% END %]

best_mx_transport = local
message_size_limit = [% pmg.mail.maxsize %]
mailbox_size_limit = [% ((pmg.mail.maxsize*2 > 51200000) ? pmg.mail.maxsize*2 : 51200000) %]

mydomain = [% dns.domain %]
myhostname = [% dns.hostname %].[% dns.domain %]

parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks,permit_mx_backup_networks,qmqpd_authorized_clients,smtpd_access_maps

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localhost, $myhostname
mynetworks = [% postfix.mynetworks %]

relay_domains = hash:/etc/pmg/domains

transport_maps = hash:/etc/pmg/transport

[% IF pmg.mail.relay %]
[% IF pmg.mail.relayprotocol == 'lmtp' %]
relay_transport = [% pmg.mail.relayprotocol %]:inet:[% pmg.mail.relay %]:[% pmg.mail.relayport %]
[% ELSE %]
[% IF pmg.mail.relaynomx %]
relay_transport = [% pmg.mail.relayprotocol %]:[[% pmg.mail.relay %]]:[% pmg.mail.relayport %]
[% ELSE %]
relay_transport = [% pmg.mail.relayprotocol %]:[% pmg.mail.relay %]:[% pmg.mail.relayport %]
[% END %]
[% END %]
[% END %]

[% IF pmg.mail.smarthost %]
default_transport = smtp:[% pmg.mail.smarthost %]:[% pmg.mail.smarthostport %]
[% END %]

[% IF ! pmg.mail.before_queue_filtering -%]
content_filter=scan:127.0.0.1:10024
[%- END %]

mail_name = Proxmox

[% IF pmg.mail.helotests %]
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks reject_non_fqdn_helo_hostname reject_invalid_helo_hostname
[% ELSE %]
smtpd_helo_restrictions =
[% END %]

postscreen_access_list =
        permit_mynetworks,
        cidr:/etc/postfix/postscreen_access

[% IF postfix.dnsbl_sites %]
postscreen_dnsbl_sites = [% postfix.dnsbl_sites %]
postscreen_dnsbl_threshold = [% postfix.dnsbl_threshold %]
[% END %]

postscreen_dnsbl_action = enforce
postscreen_greet_action = enforce

smtpd_sender_restrictions =
        permit_mynetworks
        reject_non_fqdn_sender
        check_client_access     cidr:/etc/postfix/clientaccess
        check_sender_access     regexp:/etc/postfix/senderaccess
        check_recipient_access  regexp:/etc/postfix/rcptaccess
[%- IF pmg.mail.rejectunknown %] reject_unknown_client_hostname[% END %]
[%- IF pmg.mail.rejectunknownsender %] reject_unknown_sender_domain[% END %]

smtpd_recipient_restrictions =
        permit_mynetworks
        reject_unauth_destination
        reject_non_fqdn_recipient
        check_recipient_access  regexp:/etc/postfix/rcptaccess
[%- IF postfix.usepolicy %] check_sender_access  regexp:/etc/postfix/senderaccess[% END %]
[%- IF postfix.usepolicy %] check_client_access  cidr:/etc/postfix/clientaccess[% END %]
[%- IF postfix.usepolicy %] check_policy_service inet:127.0.0.1:10022[% END %]
[%- IF pmg.mail.verifyreceivers %] reject_unknown_recipient_domain[% END %]
[%- IF pmg.mail.verifyreceivers %] reject_unverified_recipient[% END %]

[% IF pmg.mail.verifyreceivers %]
unverified_recipient_reject_code = [% pmg.mail.verifyreceivers %]
[% END %]

smtpd_client_connection_count_limit = [% pmg.mail.conn_count_limit %]
smtpd_client_connection_rate_limit = [% pmg.mail.conn_rate_limit %]
smtpd_client_message_rate_limit = [% pmg.mail.message_rate_limit %]

[% IF pmg.mail.tls %]
smtp_tls_security_level = may
smtp_tls_policy_maps = hash:/etc/pmg/tls_policy
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtpd_tls_security_level = may
smtpd_tls_cert_file = /etc/pmg/pmg-tls.pem
smtpd_tls_key_file = $smtpd_tls_cert_file

lmtp_tls_security_level = $smtp_tls_security_level
lmtp_tls_policy_maps = $smtp_tls_policy_maps
lmtp_tls_CAfile = $smtp_tls_CAfile
[% IF pmg.mail.tlslog %]
smtpd_tls_loglevel = 1
smtp_tls_loglevel = 1
lmtp_tls_loglevel = $smtp_tls_loglevel
[% END %]
[% IF pmg.mail.tlsheader %]
smtpd_tls_received_header = yes
[% END %]
[% END %]

smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_tls_session_cache
lmtp_tls_session_cache_database = btree:/var/lib/postfix/lmtp_tls_session_cache

[% IF pmg.mail.hide_received %]
unverified_recipient_reject_reason = Recipient address lookup failed
[% END %]


default_destination_concurrency_limit = 40
lmtp_destination_concurrency_limit = 20
relay_destination_concurrency_limit = 20
smtp_destination_concurrency_limit = 20
virtual_destination_concurrency_limit = 20

recipient_delimiter = +
postscreen_reject_footer = \c. We are sorry, but your message has been rejected because your IP ($client_address) is listed on a DNSBL.
postscreen_dnsbl_reply_map = texthash:/etc/postfix/dnsbl_reply

smtp_error_sleep_time = 30
 
4.3.2.1:25 inet n - - - [% pmg.mail.max_smtpd_out %] smtpd
10.10.10.4:25 inet n - - - [% pmg.mail.max_smtpd_out %] smtpd
1.2.3.4:25 inet n - - - 1 postscreen
usw. - sprich der Grund warum PMG nur auf die bestimmten ips bindet und nicht auf 0.0.0.0 und :: (womit alles funktionieren würde)
liegt an dem angepassten template.

Wenn nichts gravierendes dagegen spricht würde ich vorschlagen einfach auf diese Anpassungen zu verzichten (falls port 25/26 irgendwo nicht erreichbar sein soll vl. mit einer nftables/iptables rule verhindern)

Ich hoffe das hilft!
 
Schön, dass sich eine Lösung hat finden lassen :)

kurze frage - warum nicht nur `25` nehmen?
mit dem dns.fqdn (oder dem ausgeschriebenen) gibt es immer noch die Möglichkeit, dass vergessen wird den hosteintrag anzupassen - und dann steht das System wieder
 
Weil wohl dann auf allen IPs Port 25 belegt ist. Für den "internen", also ausgehenden Mailverkehr muss ich Port 25 auf der 2 IPv4 Adresse frei haben, da ich O365 leider keinen alternativen Port beibringen kann.

Internet -> pmg -> O365 via 1.2.3.4:25 1111:2222:3333:4444::1:25
O365 -> pmg -> Internet via 4.3.2.1:25
 
  • Like
Reactions: Stoiko Ivanov
Weil wohl dann auf allen IPs Port 25 belegt ist. Für den "internen", also ausgehenden Mailverkehr muss ich Port 25 auf der 2 IPv4 Adresse frei haben, da ich O365 leider keinen alternativen Port beibringen kann.
ah - klar - sorry - hatte den Teil des Threads vergessen
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!