Here is a configuration which should work for you. It does not modify the default configuration - vmbr0 is still bridged to eth0.
Instead we use a second bridge, called 'vmbr1'. It uses a private network '10.0.2.1/24'. All traffic is masqueraded using SNAT.
When you create a new VM simple select 'vmbr1' as bridge. Inside the VM use 10.0.2.1 as gateway.
Instead we use a second bridge, called 'vmbr1'. It uses a private network '10.0.2.1/24'. All traffic is masqueraded using SNAT.
When you create a new VM simple select 'vmbr1' as bridge. Inside the VM use 10.0.2.1 as gateway.
Code:
auto eth0
iface eth0 inet static
auto vmbr0
iface vmbr0 inet static
address 87.118.126.3
netmask 255.255.255.0
gateway 87.118.126.1
bridge_ports none
bridge_stp on
bridge_fd 0
auto vmbr1
iface vmbr1 inet static
address 10.0.2.1
netmask 255.255.255.0
bridge_ports none
bridge_stp on
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.0.2.0/24' -j SNAT --to-source 87.118.126.3
post-down iptables -t nat -D POSTROUTING -s '10.0.2.0/24' -j SNAT --to-source 87.118.126.3