Hello Everyone!
I have a question about networking in virtualbox. I've made 2 boxes, one is Client which gets ip address from DHCP Server. Here are specifications of those two boxes:
BOX1-Client
NIC: enp0s8 (NAT Network)
BOOTPROTO: dhcp
IP (automatic)
BOX2-DHCP-Server
NIC: enp0s3 (NAT Network)
BOOTPROTO: static
IP 10.0.2.20
This two machines is using NAT-Network with automatic dhcp turned off
so that BOX2 can give IP address to BOX1 and this is working great!
PROBLEM:
I can ping google.com from BOX1,(client) but not from BOX2.(server) Is it possible to set up BOX2 to ping google.com from this existing NIC(enp0s3) or there must be added additional NIC to access internet?
Here is config file for BOX2 /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE=Ethernet
BOOTPROTO=none
IPADDR=10.0.2.20
HWADDR=08:00:27:b3:9e:ad
NETMASK=255.255.255.0
NETWORK=10.0.2.0
DEVICE=enp0s3
ONBOOT=yes
DHCP_HOSTNAME=Crutex.Dhcp
...and here is config for DHCP Server /etc/dhcp/dhcpd.conf
------------------------------------------------------------
# Sample configuration file for ISC dhcpd
default-lease-time 600;
max-lease-time 7200;
ddns-update-style interim;
authoritative;
log-facility local7;
# This is a very basic subnet declaration.
subnet 10.0.2.0 netmask 255.255.255.0 {
range 10.0.2.16 10.0.2.20;
option routers 10.0.2.2;
option domain-name-servers 85.114.32.7, 85.114.32.8; # optima dns serv.
option broadcast-address 10.0.2.255;
}
-----------------------------------------------------------
WHAT AM I DOING WRONG HERE? I hope my question is not too silly
VirtualBox DHCP Server issue
VirtualBox DHCP Server issue
cRoBoo
Re: VirtualBox DHCP Server issue
VirtualBox already runs its own DHCP server for NAT connections.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: VirtualBox DHCP Server issue
Thank you for the answer, yes i know NAT has DHCP but in my scenario i was turning my BOX2 into DHCP Server ( just for learning purpose )TrevorH wrote:VirtualBox already runs its own DHCP server for NAT connections.
In this scenario i was turning off DHCP in NAT NETWORK so my BOX2 acts like DHCP and assigns IP address to BOX1.
I can't ping anything on internet with BOX2. My question was how to set correct configuration on BOX2 to ping internet. (google, or 8.8.8.8)
and is it possible? i thing there is some problem with routing ... i guess i missed something?! ...hm
cRoBoo
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Re: VirtualBox DHCP Server issue
If you want your virtual machines to talk to each other, use bridging, not NAT.
Re: VirtualBox DHCP Server issue
actually they can also talk through internal network, i need to ping "the internet" (google.com or 8.8.8.8) from BOX2 and that's not working.gerald_clark wrote:If you want your virtual machines to talk to each other, use bridging, not NAT.
cRoBoo
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Re: VirtualBox DHCP Server issue
Internal network is internal only. It cannot access 8.8.8.8. It can only reach other VMs on the same host.'
Please read your virtualbox documentation.
Please read your virtualbox documentation.
Re: VirtualBox DHCP Server issue
that's right! internal only between two virtual machines. No pinging outside!gerald_clark wrote:Internal network is internal only. It cannot access 8.8.8.8. It can only reach other VMs on the same host.'
Please read your virtualbox documentation.
cRoBoo