I have created a virtual machine with 2 network adapters, one connected to the host using NAT and the second connected through a host-only adapter.
This set-up works for what I want to do,
- Give the guest OS access to the internet (NAT interface eth0)
- Expose a web interface, hosted on the guest, to the host OS. (Host-only adapter eth1)
The problem is that the guest interface which is connected to the internet (eth0), has been assigned the same IP address, through DHCP, as the host OS.
Does anybody know how to configure virtualbox or the guest os so it gets a unique IP address?
/etc/config/network file in the guest OS:
config interface 'loopback' option ifname 'lo' option proto 'static' option ipaddr '127.0.0.1' option netmask '255.0.0.0' config interface 'lan' option ifname 'eth0' option ipaddr '10.0.2.20' option netmask '255.255.255.0' option proto 'dhcp' config interface 'lan2' option ifname 'eth1' option proto 'static' option ipaddr '10.88.12.1' option netmask '255.0.0.0' config interface 'wan6' option ifname '@wan' option proto 'dhcpv6' config globals 'globals' option ula_prefix 'fd62:86eb:0d01::/48'
If I set
static for the
lan interface, the IP address is set to
10.0.2.20 but I can not connect to the internet.