1

i have main IP:

1.2.3.4 with mask 255.255.255.0 and gateway 1.2.3.254

It is ok. Also, ISP gave me network /28. List of ip: from 1.1.1.1 and until 1.1.1.15

I can use these interfaces via aliases, like eth0:1, eth0:2, etc ...

How can i use these 15 interfaces for KVM ? Also, my configuration file:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 1.2.3.4
        netmask 255.255.255.0
        gateway 1.2.3.254
        up ip link set eth0 txqueuelen 10000

auto eth0:1
iface eth0:1 inet static
        address 1.1.1.1
        netmask 255.255.255.240

auto eth0:1
iface eth0:1 inet static
        address 1.1.1.2
        netmask 255.255.255.240

...
...
...

How can i use these interfaces for my KVM ? What ways to use aliases in KVM ? Bridge ? Proxy_arp ? I did bridge for vlans, but how i know it does not work for alises. Can you help me ?

Piduna
  • 541
  • 4
  • 12
  • 25

1 Answers1

2

It is better to create a bridge with the interface eth0 and attach virtual machines interfaces to this bridge, and not to use aliases. See how to do it: Configure public IP addresses in KVM VMs. You config will look like this if you create vmbr0 (and assign main ip to it).

auto lo
iface lo inet loopback

iface eth0 inet manual

auto vmbr0
iface vmbr0 inet static
    address 1.2.3.4
    netmask 255.255.255.0
    gateway 1.2.3.254
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0
Gnat
  • 279
  • 1
  • 3