Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
kvm and dnsmasq configuration
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1158

PostPosted: Sat Oct 17, 2015 3:44 pm    Post subject: kvm and dnsmasq configuration Reply with quote

I noticed that virtual machine using NAT (virt-network) refer to 192.168.122.1(host) as the dns
and the host is using the dnsmasq to provide that service

I would like to add an mx record to that server
when I opened up the /etc/dnsmasq.conf I found everything was commented out

thanks
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1158

PostPosted: Sun Oct 18, 2015 7:08 pm    Post subject: Reply with quote

help anyone
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42596
Location: 56N 3W

PostPosted: Sun Oct 18, 2015 8:50 pm    Post subject: Reply with quote

Adel Ahmed,

Your libvirt network settings are stored in /etc/libvirt/qemu/networks/
If you only have one entry, edit it with
Code:
virsh net-edit default
not with $EDITOR

I'm not sure why you would want to add an MX record there though. That's something you add to a DNS nameserver

You add an MX record to point to your server. That implies you have a public IP which you DNAT to your virtual host, or at the very least, port 25.
DNAT in this way is a job for iptables.

Tell us your actual problem rather than your perceived solution.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1158

PostPosted: Mon Oct 19, 2015 11:08 pm    Post subject: Reply with quote

I'm studying for the RHCE exam, and I thought I would setup an internal mail delivery system as practice for the exam
I would like to send emails within the domain(subnet) using postfix

I appreciate your assistance
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42596
Location: 56N 3W

PostPosted: Tue Oct 20, 2015 5:48 pm    Post subject: Reply with quote

Adel Ahmed,

You need to have a nameserver with a MX record that paints to the public IP of your mailserver, if you want to receive mail from the big bad internet.
That makes things easier as the nameserver probably exists anyway.

If you will just do this on a private closed network, you need to run your own nameserver.
Hosts that will send/fetch mail need to use it as one of their nameservers.
nameservers are not trivial to sent up so for testing, you can use /etc/hosts to do name to IP address resolution. /etc/hosts will need to be populated on every mail sender/fetcher.

On you KVM host, you need either an IP, which you DNAT to the KVM (all ports) or you use the KVM hosts IP and DNAT email ports to your KVM.
Either way, you need iptables to do the DNAT and forwarding.

Now your mailserver on your KVM can receive emails from the outside world and deliver them to user accounts on the mailserver.
Users can collect their mail with pop3 or whatever.

You can doubtless ssh into the KVM host and from the KVM host to the KVM itself.
A good first step is to set up iptables so that you can ssh to the KVM directly from elsewhere on the network.

Hint: If you share the KVM hosts IP address, do not use port 22 for the guest, or you will no longer be able to reach the host.
You need both DNAT and forwarding. You also need to configure ssh on the KVM to listen on an additional port, other than 22.
After this works, its the same only different ports for your email services.

Once the network is in place, the mail server setup is standard. It has no idea its being hosted on a KVM.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1158

PostPosted: Sun Oct 25, 2015 1:48 am    Post subject: Reply with quote

that's a good idea, I have configured a bind server on one of the hosts and I'm getting other sorts of problems now, this problem is solved for now

thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum