Author Topic: connection refused to a domain on another virtual machine  (Read 695 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Re: connection refused to a domain on another virtual machine
« Reply #15 on: October 20, 2024, 07:34:32 PM »
Disable CSF/IPtables and run tests 2,3 again. If the tests are passed with the disabled CSF/iptables then check your CSF/iptables  rules.
Test 2 failed buit test 3 work, i got the traceroute for test 3

Offline
**
Re: connection refused to a domain on another virtual machine
« Reply #16 on: October 20, 2024, 10:09:14 PM »
1. Did you disable CSF/Firewall on both VMs ? Does it try to access the VM2 from VM1 using public or private IP ?

2. What did the test 2 show exactly when it failed ?

3. does "nslookup MX.DOMAIN.COM"  (replace MX.DOMAIN.COM with the actual MX record of the domain hosted on VM2) executed on VM1 shows the same result as "dig" ?

Offline
*
Re: connection refused to a domain on another virtual machine
« Reply #17 on: October 21, 2024, 09:59:46 AM »
1. Did you disable CSF/Firewall on both VMs ? Does it try to access the VM2 from VM1 using public or private IP ?

2. What did the test 2 show exactly when it failed ?

3. does "nslookup MX.DOMAIN.COM"  (replace MX.DOMAIN.COM with the actual MX record of the domain hosted on VM2) executed on VM1 shows the same result as "dig" ?

For 1:
  • Yes i did disabled firewall on both VM
  • he try to access VM2 using public ip

For 2:
  • Connection refused print-screen down


For 3:
  • Post the picture below with all comands (nslookup, dig, telnet)
« Last Edit: October 21, 2024, 10:01:24 AM by Thorth »

Offline
**
Re: connection refused to a domain on another virtual machine
« Reply #18 on: October 21, 2024, 11:06:08 AM »
If you disabled CSF/Firewall, dig, nslookup show correct answers but you can't connect to the port 25 of another VM then there is some networking problem. It could be your router or some other device used to manage traffic. I am afraid the CWP community is unable to help you with it because it requires deeper understanding of your infrastructure and network configuration.

Offline
*
Re: connection refused to a domain on another virtual machine
« Reply #19 on: October 21, 2024, 11:52:00 AM »
If you disabled CSF/Firewall, dig, nslookup show correct answers but you can't connect to the port 25 of another VM then there is some networking problem. It could be your router or some other device used to manage traffic. I am afraid the CWP community is unable to help you with it because it requires deeper understanding of your infrastructure and network configuration.

I will check my router NAT config then.
thank u very much for your help

Offline
**
Re: connection refused to a domain on another virtual machine
« Reply #20 on: October 21, 2024, 03:26:36 PM »
thank u very much for your help

No problem. I wish you to find root of the problem and solve it to get maximum from your infrastructure and CWP panel.

Offline
*
Re: connection refused to a domain on another virtual machine
« Reply #21 on: October 21, 2024, 05:35:01 PM »
thank u very much for your help

No problem. I wish you to find root of the problem and solve it to get maximum from your infrastructure and CWP panel.

I will post here the solution i found, so if anybody get into the same issue maybe they can find the solution.

Offline
*
Re: connection refused to a domain on another virtual machine
« Reply #22 on: October 25, 2024, 12:55:10 PM »
Hi again.
I found out the solution for this issue.
So basically since they are in a private network (those two VM, have local ip) there is a conflict on port 25 when they try to send internally between server.

The solution:


Edit
Code: [Select]
/etc/hosts and add the local IP and the domains from the other machine (the MX record for each)

Edit
Code: [Select]
/etc/postfix/transport and there add info from others domain like

  • DOMAIN.com              smtp:192.168.0.XX:25
  • .DOMAIN.com              smtp:192.168.0.XX:25

Run the command
Code: [Select]
postmap /etc/postfix/transport from terminal
 

What this solution will do is not seding the email via internet and relay the emails to the machine where is hosted, like an internal email. The details in transport file will filter emails based on domain. This way i was able to send emails both internal and to other domain outside the network.

Offline
**
Re: connection refused to a domain on another virtual machine
« Reply #23 on: October 25, 2024, 01:05:23 PM »
Did you check what happens when CWP rebuilds the mail config ? Does it not remove the extra records (transport policy) added by hand ?

Just for information if someone decides to apply the same solution.

Thank you.

Offline
*
Re: connection refused to a domain on another virtual machine
« Reply #24 on: October 25, 2024, 02:05:53 PM »
I did not check this, but it's a good point, i should check soon. Also idk maybe it's a good idea for cwp since there is an option there for email exchange i think is the same, to add this option, to relay emails. I'll be back with the situation after rebuild postfix

Offline
*
Re: connection refused to a domain on another virtual machine
« Reply #25 on: October 25, 2024, 05:18:03 PM »
Alright so i try the rebuild of the server.
On rebuild of the server /etc/postfix/transport will reset so is need it to add again so everyone will try this solution, must remember this, on every rebuild transport file will reset and need to be completed with the domains and the command
Code: [Select]
postmap /etc/postfix/transport must be run again
« Last Edit: October 25, 2024, 05:19:42 PM by Thorth »