2022-04-14T16:42:58 Error opnsense /firewall_virtual_ip.php: The command `/sbin/ifconfig 'lo0' inet '192.168.64.1' -alias' failed to execute
## Automatically generated configuration.# Do not edit this file manually.#global uid 80 gid 80 chroot /var/haproxy daemon stats socket /var/run/haproxy.socket group proxy mode 775 level admin nbproc 1 nbthread 2 hard-stop-after 60s no strict-limits maxconn 10000 tune.ssl.default-dh-param 4096 spread-checks 2 tune.bufsize 16384 tune.lua.maxmem 0 log /var/run/log local0 info lua-prepend-path /tmp/haproxy/lua/?.luadefaults log global option redispatch -1 maxconn 5000 timeout client 30s timeout connect 30s timeout server 30s retries 3 default-server init-addr last,libc# autogenerated entries for ACLs# autogenerated entries for config in backends/frontends# autogenerated entries for stats# Frontend: 0_SNI_frontend (Listening on 0.0.0:80, 0.0.0.0:443)frontend 0_SNI_frontend bind 0.0.0.0:443 name 0.0.0.0:443 bind 0.0.0.0:80 name 0.0.0.0:80 mode tcp default_backend SSL_backend # tuning options timeout client 30s # logging options# Frontend: 1_HTTP_frontend (Listening on 192.168.64.1:80)frontend 1_HTTP_frontend bind 192.168.64.1:80 name 192.168.64.1:80 accept-proxy mode http option http-keep-alive option forwardfor # tuning options timeout client 30s # logging options # ACL: NoSSL_condition acl acl_62565b172acae6.05588153 ssl_fc # ACTION: HTTPtoHTTPS_rule http-request redirect scheme https code 301 if !acl_62565b172acae6.05588153# Frontend: 1_HTTPS_frontend (Listening on 192.168.64.1:443)frontend 1_HTTPS_frontend http-response set-header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" bind 192.168.64.1:443 name 192.168.64.1:443 accept-proxy ssl curves secp384r1 no-sslv3 no-tlsv10 no-tlsv11 no-tls-tickets ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES256-GCM-SHA384 ciphersuites TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 alpn h2,http/1.1 crt-list /tmp/haproxy/ssl/62565eb5d0ff12.02152772.certlist mode http option http-keep-alive option forwardfor # tuning options timeout client 30s # logging options # ACL: LOCAL_SUBDOMAINS_SUBNETS_condition acl acl_6257dfacde7e16.43417850 src_is_local # ACTION: LOCAL_SUBDOMAINS_map-rule use_backend %[req.hdr(host),lower,map_dom(/tmp/haproxy/mapfiles/6257d684d34507.32920094.txt)] if acl_6257dfacde7e16.43417850 # ACTION: PUBLIC_SUBDOMAINS_map-rule # NOTE: actions with no ACLs/conditions will always match use_backend %[req.hdr(host),lower,map_dom(/tmp/haproxy/mapfiles/62565c00b116b3.27816426.txt)] # Backend: SSL_backend ()backend SSL_backend # health checking is DISABLED mode tcp balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s server SSL_server 192.168.64.1 send-proxy-v2 check-send-proxy# Backend: MineOS_backend ()backend MineOS_backend # health checking is DISABLED mode http balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s http-reuse safe server MineOS_server 192.168.1.103:8443 ssl verify none# Backend: Prism_backend ()backend Prism_backend # health checking is DISABLED mode http balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s http-reuse safe server Prism_server 192.168.1.103:2342
# public access subdomainsmineos MineOS_backend
# local access subdomainsprism Prism_backend# public access subdomainsmineos MineOS_backend
mineos.website.com > works locally and externallyprism.website.com > 503 error locally and externally
Try to use "Source IP matches a specific IP" instead
Informational haproxy 10.10.10.206:63264 [19/Apr/2022:17:26:27.483] 1_HTTPS_frontend/10.12.0.1:443: Received something which does not look like a PROXY protocol header
global uid 80 gid 80 chroot /var/haproxy daemon stats socket /var/run/haproxy.socket group proxy mode 775 level admin nbproc 1 nbthread 4 hard-stop-after 60s no strict-limits maxconn 10000 tune.ssl.default-dh-param 4096 spread-checks 2 tune.bufsize 16384 tune.lua.maxmem 0 log /var/run/log local0 info lua-prepend-path /tmp/haproxy/lua/?.luadefaults log global option redispatch -1 maxconn 5000 timeout client 30s timeout connect 30s timeout server 30s retries 3 default-server init-addr last,libc# autogenerated entries for ACLs# autogenerated entries for config in backends/frontends# autogenerated entries for stats# Frontend: 0_SNI_frontend ()frontend 0_SNI_frontend bind 0.0.0.0:443 name 0.0.0.0:443 bind 0.0.0.0:80 name 0.0.0.0:80 mode tcp default_backend SSL_backend # tuning options timeout client 30s # logging options# Frontend: 1_HTTP_frontend ()frontend 1_HTTP_frontend bind 10.12.0.1:80 name 10.12.0.1:80 accept-proxy mode http option http-keep-alive option forwardfor # tuning options timeout client 30s # logging options # ACL: NoSSL_condition acl acl_60d1a0c1b278f7.63252237 ssl_fc # ACTION: HTTPtoHTTPS_rule http-request redirect scheme https code 301 if !acl_60d1a0c1b278f7.63252237# Frontend: 1_HTTPS_frontend ()frontend 1_HTTPS_frontend http-response set-header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" bind 10.12.0.1:443 name 10.12.0.1:443 accept-proxy ssl curves secp384r1 no-sslv3 no-tlsv10 no-tlsv11 no-tls-tickets ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES256-GCM-SHA384 ciphersuites TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 alpn h2,http/1.1 crt-list /tmp/haproxy/ssl/6256591773a972.14047672.certlist mode http option http-keep-alive option forwardfor # tuning options timeout client 15m # logging options # ACTION: PUBLIC_SUBDOMAINS_map-rule # NOTE: actions with no ACLs/conditions will always match use_backend %[req.hdr(host),lower,map_dom(/tmp/haproxy/mapfiles/625655d89e4274.43878203.txt)] # Backend: bitwarden_backend ()backend bitwarden_backend # health checking is DISABLED mode http balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s http-reuse safe server bitwarden_host 10.10.10.11:8080 # Backend: acme_challenge_backend (Added by Let's Encrypt plugin)backend acme_challenge_backend # health checking is DISABLED mode http balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s http-reuse safe server acme_challenge_host 127.0.0.1:43580 # Backend: SSL_backend ()backend SSL_backend # health checking is DISABLED mode tcp balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s server SSL_server 10.12.0.1 send-proxy-v2 check-send-proxy
My services are available from the outside. But from inside they are not accessible.
Well, there you got the point of error.You probably configured the wrong IP in your DNS overwrites.What is your OPNsense LAN IP, what is the DNS Overwrite IP and what is the virtual IP of the "HAProxy SSL Server"?
Edit: Ok, changed the Override IP to my LAN IP (10.10.10.1). Now it works. But to be honest, i do not understand why.
Quote from: Bothson on April 19, 2022, 08:50:05 pmEdit: Ok, changed the Override IP to my LAN IP (10.10.10.1). Now it works. But to be honest, i do not understand why.You error explains why!Code: [Select]Informational haproxy 10.10.10.206:63264 [19/Apr/2022:17:26:27.483] 1_HTTPS_frontend/10.12.0.1:443: Received something which does not look like a PROXY protocol headerThe HTTPS_frontend expects that all data sent to it has the "proxy protocol header".Since you pointed your internal requests directly to your HTTPS_frontend (HAProxy_VIP) instead of your SNI_frontend (any of the real local IPs of your OPNsense) the data didn't get the PROXY protocol header attached by the SSL_backend.
I am not sure if this is the correct way to achieve multiple domains pointing to different backends but it seems to be working for me. At first I ran into a issue were all domains could access the same subdomain, this is when I realized I just needed some extra conditions. Here are the steps to achieve; service.example.com & service1.example1.comServices --> ACME Client --> CertificatesAdd the certificate for your extra domains and forcefully issue your certificateServices --> HAProxy --> Settings --> Virtual Services --> Public ServicesFinally we edit our "1_HTTPS_frontend"Add all extra domains in the "Certificates" input.
old===nas NAS_backendnew===nas.domain1.com NAS_1_backendnas.domain2.com NAS_2_backend
@theHellSiteHelloWhen I overide the dns Server will the haproxy still be used or not?