It happens that we were given a proposal no one is seeming to figure out (or care) to do.
The initial exercise comprises of:
Create two Virtual Machines:
• Ubuntu 19.04 - as a Server
• Windows 10 - as a Client
Server will have the first NIC as NAT, and it is being assigned an IP number 10.0.2.15. (I will call this NIC1)
Server will also have a secondary NIC as Internal Network and the IPs will be manually configured. (I will call this NIC2)
This setup is to simulate a server that has access to the WAN from NIC/NAT (NIC1), and handle DHCP to clients through NIC/Internal (NIC2).
Client will have only one NIC as Internal Network and all the IP configuration will be fetched from the Server.
So, on Server, the /etc/network/interfaces look like this:
Code: Select all
auto lo
iface lo inet loopback
auto enp0s3
iface enp0s3 inet dhcp
auto enp0s8
iface enp0s8 inet static
network 172.16.0.0
address 172.16.0.1
netmask 255.255.0.0
broadcast 172.16.255.255
The file /etc/default/isc-dhcp-server has the statement: INTERFACESv4=enp0s8, so that this NIC2 will handle it all.
Remember that our enp0s3 is the NAT (NIC1).
OK. So everything is doing as it is supposed to do. The Windows Client is getting 172.16.0.10 as its IP.
But there is no Internet access in Windows client.
Then it came the part where we were supposed to configure BIND to give Windows a DNS so that it can ping domains.
But this somehow is not working using Internal Adapters.
It works just with the two VMs in Bridge Mode, which is a bit of a hack, considering that we were supposed to follow up the exercise from DHCP.
So, some people just called it a day and changed the two VMs to bridge mode and did the BIND exercise.
But I'm left as the only one trying to figure out how to deliver this, following it up.
On the Client side, the firewall has been disabled.
On the Server side, the file /proc/sys/net/ipv4/ip_forward had its content set from 0 to 1.
Addionally, someone told me to use iptables to "enable the communication" between the machines, but I found it a bit weird since we are talking about two different networks.
The commands here listed were used to set up some rules on Server. The following commands to clean all the rules.
Code: Select all
# iptables -F
# iptables -X
# iptables -t nat -X
# iptables -t nat -F
Code: Select all
# iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
# iptables -t nat -A POSTROUTING -o enp0s3 -j MASQUERADE
Doing those, won't allow Windows to get Internet Connection. It simply doesn't work.
NOW TO THE ISSUE.
Since BIND is listening on enp0s3 (NIC1/NAT) and Windows is living by internal network 172.16.0.0 (enp0s8)- there is no way to tell Windows to listen to 10.0.2.15 for DNS.
Nothing happens if you tell Windows to do it.
SO WHAT TO DO NOW? HOW TO FEED THE INTERNET from enp0s3 to enp0s8, so it will deliver to Windows Client?
I basically need that enp0s3 will communicate to enp0s8. In other words, I need one internal VM to communicate with another internal VM in this setup, if it's possible.
Something tells me that all is lacking is some more configuration to the Linux Server.
At this point, BIND matters no more, because I feel something elemental here is being ignored.
Someone help me to get this Windows machine with DHCP to get the access to the internet from the Linux Server. If it's possible.
No alterations in configurations like "set in bridge mode" or what have you. If it's not possible, with VirtualBox, in the proposed way, just say it.
Thank you for any replies that will lead to a solution.
All credits will be given.