A
A
Alexey Nechaev2012-11-21 10:37:05
linux
Alexey Nechaev, 2012-11-21 10:37:05

Networking in KVM, Gateway

There is a small question about organizing the correct network for virtual machines on KVM;

there is a host on ubuntu 12.10 that acts as a gateway in the local network ;
it has two interfaces
eth0 - Internet xx.xx.xx.xx
eth1 - local network (with dhcp) 192.168.1.0/24
and
virtbr0 — bridge created by KVM 192.168.122.0/24

Now there are several virts running in KVM. machines, they were given an IP on the network 192.168.122.0, all have access to the Internet. everything works perfectly. But machines on the local network do not have access to virtual machines.

How to make the local network have access to virtual machines (to the sub-network 192.168.122.0) or make the virtual machines receive IP addresses from the sub-network 192.168.1.0 and they were respectively in 192.168.1.0

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Nechaev, 2012-11-22
@Dmarck

I sort of figured it out:
Created another bridge
auto br0
iface br0 inet static
address 192.168.1.1
netmask 255.255.255.0
bridge_ports eth1
bridge_fd 0
bridge_hello 2
bridge_maxage 12
bridge_stp off
bridge_maxwait 0
And replaced eth1 with:
auto eth1
iface eth1 inet manual
+ corrected dhcpd settings by
replacing After the reboot, everything worked, the local machines from the network see the virtual ones and vice versa. Well, ip addresses are distributed to everyone by the dhcpd server of the host.
INTERFACES="eth1"
INTERFACES="br0"

A
alz, 2012-11-21
@alz

enable eth1 in virtbr0 bridge

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question