KVM Networking

Issues related to configuring your network
smrtalex1
Posts: 14
Joined: 2022/08/14 00:30:23

Re: KVM Networking

Post by smrtalex1 » 2022/08/14 23:58:29

I can confidently say that it does not work when put on the host server. The gateway (default route) must be in the same subnet as the IP address. Something else is going on, perhaps the settings when on the host server are slightly different, or the host server has additional IP addresses?
You are correct. The host server does have 2 additional IP's. at br0:1 and a br0:2

Could that make a difference?

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: KVM Networking

Post by Whoever » 2022/08/15 00:36:29

smrtalex1 wrote:
2022/08/14 23:58:29
I can confidently say that it does not work when put on the host server. The gateway (default route) must be in the same subnet as the IP address. Something else is going on, perhaps the settings when on the host server are slightly different, or the host server has additional IP addresses?
You are correct. The host server does have 2 additional IP's. at br0:1 and a br0:2

Could that make a difference?

Absolutely. It's also possible that your ISP (OVH?) has done some tricky network configuration.

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: KVM Networking

Post by jlehtone » 2022/08/15 08:46:19

Whoever wrote:
2022/08/15 00:36:29
smrtalex1 wrote:
2022/08/14 23:58:29
You are correct. The host server does have 2 additional IP's. at br0:1 and a br0:2
Absolutely. It's also possible that your ISP (OVH?) has done some tricky network configuration.
The ifname:N is "IP aliasing". One creates "virtual" subinterfaces. Each interface has IP address and therefore the physical interface has more than one address. However, IP aliasing is outdated because Linux kernel does now allow multiple addresses on one interface. (On IPv6 that is used extensively.)

One can have more than one distinct subnet on same wire, but each of them must have their own router. It is more common now to distinguish the traffic of each subnet with VLAN tags. (VLAN tagging requires separate virtual interfaces.)


We do not have a clear picture of what the ISP requires and expects you to do. Could you explain to their support that you try to get address/connectivity to VM and ask how to do it?
Last edited by jlehtone on 2022/08/16 06:33:49, edited 1 time in total.

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: KVM Networking

Post by Whoever » 2022/08/16 04:58:01

I would also suggest that you change your obfuscation scheme and post the last 2 octets of all the IP addresses and address ranges. Without the first two octets it should still be sufficiently obfuscated.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: KVM Networking

Post by TrevorH » 2022/08/16 09:29:24

OVH use a weird network setup where the gateway is not in the same subnet as the host ip. You have to do special stuff to add a route to the gateway ip via the device prior to adding the default route. Something like

ip ro add 2.3.4.5 dev eth0
ip ro add default via 2.3.4.5
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: KVM Networking

Post by jlehtone » 2022/08/16 10:55:23

Thanks,

The first thing is to test whether that connects the VM to "the internet".

The "2.3.4.5 dev eth0" is a static route. The "2.3.4.5" is more specific destination than
the "default", so it should match "first" even when the default route is added "prior".


Alas, the ip commands affect only currently running session.
There are multiple ways to store the config so that it is applied on every boot.

The default on EL (starting with EL7) is to configure network with NetworkManager.service (NM).
  • nmcli con mod eth0 ipv4.routes 2.3.4.5 might add the static route "the NM way"
  • If one installs package NetworkManager-dispatcher-routing-rules, then NM will read initscripts-format files.
    Then file /etc/sysconfig/network-scripts/route-eth0 with content:
    2.3.4.5 dev eth0
    should create the static route on service start.
If one does revert to network.service, then the same initscripts-format file should work.

Note: the "eth0" for nmcli is name of connection. The "eth0" for 'ip' and initscripts is name of interface.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: KVM Networking

Post by TrevorH » 2022/08/16 11:35:20

so it should match "first" even when the default route is added "prior".
IIRC, it won't let you add a route via a destination it cannot currently reach, hence the need to add the specific route before you can try to add the default route via it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

smrtalex1
Posts: 14
Joined: 2022/08/14 00:30:23

Re: KVM Networking

Post by smrtalex1 » 2022/08/16 12:51:27

TrevorH wrote:
2022/08/16 09:29:24
OVH use a weird network setup where the gateway is not in the same subnet as the host ip. You have to do special stuff to add a route to the gateway ip via the device prior to adding the default route. Something like

ip ro add 2.3.4.5 dev eth0
ip ro add default via 2.3.4.5
Does this get put into the host or the VM and is your "2.3.4.5" the Failover IP or the Gateway IP?

Lots of good information to go over here in this thread! Thank you all so far!!!

smrtalex1
Posts: 14
Joined: 2022/08/14 00:30:23

Re: KVM Networking

Post by smrtalex1 » 2022/08/16 12:54:19

We do not have a clear picture of what the ISP requires and expects you to do. Could you explain to their support that you try to get address/connectivity to VM and ask how to do it?
OVH is not very helpful when it comes to configuration. :( They basically provided this link: https://docs.ovh.com/gb/en/dedicated/network-bridging/

smrtalex1
Posts: 14
Joined: 2022/08/14 00:30:23

Re: KVM Networking

Post by smrtalex1 » 2022/08/16 12:58:00

Whoever wrote:
2022/08/16 04:58:01
I would also suggest that you change your obfuscation scheme and post the last 2 octets of all the IP addresses and address ranges. Without the first two octets it should still be sufficiently obfuscated.
Good idea! Here are the parameters of the configuration:

Server MAIN IP = ZZZ.ZZZ.79.146
FAILOVER IP = xxx.xxx.149.161
GATEWAY FOR BOTH MAIN IP AND FAILOVER IP = ZZZ.ZZZ.79.254
NETMASK FOR FAILOVER IP = 255.255.255.252
Last edited by smrtalex1 on 2022/08/16 14:01:24, edited 1 time in total.

Post Reply