Wednesday, April 24, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1391  / 3 Years ago, mon, october 18, 2021, 1:07:20

I'm trying to setup a virtualized server up with KVM on my OVH server. However, when configuring the network, I'm encountering some issues. Any help in any form is greatly appreciated!



This is my current, working setup



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address (public ip)
netmask 255.255.255.0
network (public ip).0
broadcast (public ip).255
gateway (public ip).254


In order to set up my virtualized server, I need to set up another network for the virtualized instance to go through. So, I tried adding this to my interfaces file:



auto br0
iface br0 inet static
address 192.168.40.134
network 192.168.40.0
netmask 255.255.255.0
broadcast 192.168.40.255
gateway (public ip).254
dns-nameservers 8.8.8.8 8.8.4.4
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off


However, restarting the network setup causes the server to become inaccessible over the internet. I've tried multiple times different variations to get this to work, however, it's becoming tedious to boot the server into rescue mode, fix it, and get out.



Once again, thanks in advance!


More From » networking

 Answers
2

You have three options that I can think of.



Remove the auto eth0 and replace it with auto br0. Configure the bridge with your public IP configuration. If you need an internal address range add it as an extra address using ip or as br0:1. I believe you can have only one bridge if you add an inter face to it.



Configure the bridge separate from the eth0 interface. This is the configuration I use modified with your addresses. You do not want to add a gateway to this interface. You will need to configure iptables to do SNAT (masq) and forward packets.



iface br0 inet static
address 192.168.40.1
netmask 255.255.255.0
pre-up brctl addbr br0
post-down brctl delbr br0


Configure the network in KVM and configure it to autostart. KVM will then configure the bridge for you.


[#26825] Monday, October 18, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ainbby

Total Points: 184
Total Questions: 115
Total Answers: 112

Location: Colombia
Member since Thu, Sep 29, 2022
2 Years ago
ainbby questions
Thu, Mar 23, 23, 10:26, 1 Year ago
Wed, May 10, 23, 00:10, 1 Year ago
Fri, Apr 15, 22, 10:11, 2 Years ago
;