K
K
Kodeks2014-11-09 19:45:07
linux
Kodeks, 2014-11-09 19:45:07

How to setup network for guest OS?

Good afternoon. Please help.
There is a host with a guest virtual machine.
The host has internet access through br0 and access to the virtual machine through virbr0. IP of the virtual machine 192.168.122.10
How to configure iptables on the host so that the virtual machine goes online?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Petrikov, 2014-11-09
@RicoX

On the host:

echo 1 > /proc/sys/net/ipv4/ip_forward
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf   
iptables -t nat -A POSTROUTING -s 192.168.122.0/24 -j MASQUERADE

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question