Page 1 of 1
[SOLVED] Need to map Guest IP to Host IP
Posted: 1. May 2017, 00:39
by MarkFoley
I have an XP virtual machine running under Slackware 14.2. My LAN IPs are 192.168.0/24. The Virtual Machine Linux host is IP 192.168.0.2. The Virtual Machine XP guest assigns the IP 10.0.2.15. Since other workstations need to access the SQL Server port on the XP VM, they need to do so as 192.168.0.2:1433, not 10.0.2.15:1433. The former works, the latter does not.
I've modified the Linux Host DNS zone file to create an A record for the XP (hostname traverse) as:
Code: Select all
A 192.168.0.2
:
:
$TTL 1200 ; 20 minutes
TRAVERSE A 192.168.0.2
COMMON A 192.168.0.58
but...
Code: Select all
$ host TRAVERSE
TRAVERSE.hprs.local has address 10.0.2.15
where the hostname in question is 'traverse'. If I could get `host traverse` returning 192.168.0.2, my problem would be solved. Does anyone have any DNS wisdom that would accomplish this?
Re: Need to map Guest IP to Host IP
Posted: 1. May 2017, 20:36
by MarkFoley
Part of issue resolved. The serial numbers shown in the logfile when starting named were not what I had set them to when I edited the zone file. They were were not correct because named was looking in /etc/samba/private/dns instead of the ones I modified in /var/lib/samba/private/dns. This was a result of Slackware changing the location of samba files between Samba version 4.2.14 and 4.4.8. This bit me before. I corrected the location of the zone files. Now when I restart named I do get the correct serial number in the log. And, I get the correct host:
Code: Select all
$ host traverse
TRAVERSE.hprs.local has address 192.168.0.2
However, I have not yet restarted the VM to see if it clobbers this IP. Will do so ASAP, but I'm having other problems at the moment.
Re: Need to map Guest IP to Host IP
Posted: 1. May 2017, 23:11
by MarkFoley
Yup - that worked! I was able to access SQL Server on the VM.
Re: Need to map Guest IP to Host IP
Posted: 2. May 2017, 02:57
by MarkFoley
Well, not quite. I added an 'A' record to the zone file, shutdown the VM guest, flushed the DNS cache and restarted the VM. When I did the `host` command I got:
Code: Select all
$ host traverse
TRAVERSE.hprs.local has address 192.168.0.2
I was then able to connect to the SQL Server database from other workstations. When I checked back later I got:
Code: Select all
$ host traverse
TRAVERSE.hprs.local has address 10.0.2.15
and can no longer connect. Someone on another site suggested "Take a look at the TCP/IP properties in the XP guest. I am sure there's a setting there for the DHCP-assigned name to be registered in DNS."
So, is that true? Is there a setting on the XP Guest to register or not the DHCP-assigned address? If so, I could disable that. If not, I need to look elsewhere for a solution.
Help! This is getting urgent. Users cannot access the SQL Server.
Re: Need to map Guest IP to Host IP
Posted: 2. May 2017, 19:48
by MarkFoley
Thanks to help at LinuxQuestions I've got the solution. The XP has to be set to not register the IP with DNS:
Control Panel > Network Connections > right-click on network > Properties > Internet Protocol (TCP/IP) > Properties > Advanced > DNS, un-check "Register this connection's addresses in DNS"