0

The host at my datacenter owns a single IP that is bound to eth0:
(Example values)

auto eth0
iface eth0 inet static
  address 192.88.99.111
  netmask 255.255.255.0
  gateway 192.88.99.1

In addition to that, i own a real /24 Subnet that gets routed to my datacenter and from there to my servers. Example Details:

IP address: 199.199.199.0
Subnet: 255.255.255.0
Gateway: 199.199.199.1

I managed to create a network for my docker containers, assign public IPs to them and reach them from everywhere in the world.
Thats my docker network config:

"Driver": "macvlan",
    "EnableIPv6": false,
    "IPAM": {
        "Driver": "default",
        "Options": {},
        "Config": [
            {
                "Subnet": "199.199.199.0/24",
                "Gateway": "199.199.199.1"
            }
        ]
    },
    "Options": {
        "parent": "eth0"
    },
    "Labels": {}

I am using macvlan and the host interface as parent for docker.

I'm struggling since a few weeks now, trying to configure the same for libvirt to be able to create virtual machines with my public subnet.

But I cannot get the route to work. I read a ton about bridging, forwarding and routing and tried nearly all of them. But I cannot get the bridge config, host network config and preseed config to work together, so that the VM is finally able to connect to the outside world and visa versa using my public IP space.

Is someone out there that could help me out and could provide me an example network config I could use as default network when using virt-install that works the same as the docker network?
Hints or thoughts on that would also be highly appreciated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.