D
D
Denis Goltsev2014-10-16 22:58:08
Computer networks
Denis Goltsev, 2014-10-16 22:58:08

How to give the IP address to the host machine from the guest?

The task is that, there is a host machine with KVM, guest with pfsense. There are also 2 network cards.
At the moment, the network distributes a home router, but after the configuration it will be an access point. The host machine itself is assigned an IP from the home router, but I want to create a bridge between the network and guest machine and configure Internet access in pfsense itself. There are no difficulties with this.
The difficulty lies in the fact that by forwarding the first network card to the guest machine, I will lose access to the host. And I plan that the second network card, which will be like a lan port (and already forwarded to the virtual machine) distributes the Internet and I want it to give out the ip to the host machine.
The question is how to connect to the bridge and get the address that the guest machine distributes to the host.
I'm using Debian 7. I hope I fully outlined what's what and what is needed.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Zhurkin, 2014-10-19
@SqIdWaRd

> The difficulty lies in the fact that having forwarded the first network card to the guest machine, I will lose access to the host.
You don't need to forward the network card. You need to make a bridge.
iface eth0 inet manual
auto vmbr0
iface vmbr0 inet static (or dhcp then address and netmask are not needed)
address xxxx
netmask xxxx
bridge_ports eth0 (here we select the interface for the bridge)
bridge_stp off
bridge_fd 0
We already call the virtual machine to use vmbr0.

G
Glueon, 2014-10-17
@Glueon

No, unfortunately it's not very clear. If possible, draw an approximate diagram of what you want to get. Explain what you mean by "forward".
If you want the guest machine to be the same equal participant in the network, then you just need to create a bridge, connect eth0 and a virtual network card to it. Then the virtual machine itself will receive IP via DHCP or whatever you have there.
After the introduction of the bridge, it must take over the IP address of the network card. interfaces will then look something like this:

iface eth0 inet manual
iface br0 inet static
     address x.x.x.x.x
     netmask x.x.xx.x
     bridge_ports eth0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question