V
V
Valeriu1472017-03-11 11:02:06
Computer networks
Valeriu147, 2017-03-11 11:02:06

How to create a bridge for KVM without binding to eth*, but with Internet access?

I have a small task. I need to create a bridge br1 with Internet access and without being tied to a physical interface. What I did:
My interface is br1

DEVICE=br1
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.1
NETMASK=255.255.255.0
NM_CONTROLLED=no

In iptables I wrote this:
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j SNAT --to-source 192.168.122.1

192.168.122.1, my IP address, which has Internet access
Do you think that this is enough, since virbr0 has Internet access, but when I bind br1 to my virtual machine, there is no Internet. Maybe I forgot some other rules? Tell me please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wexter, 2017-03-11
@Wexter

sysctl -w net.ipv4.ip_forward=1
well, if forward is disabled for everyone in the firewall, then enable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question