0

I currently have 64 ip addresses I'm trying to make 64 public facing kvms vms each with their own dedicated ip.

I'm a bit confused in editing the /etc/network/interfaces how I would go about doing this. I know with ubuntu 16.04 + you have to make a bridge.

Currently my ifconfig is as follows

$ ifconfig -a
eno1      Link encap:Ethernet  HWaddr 24:6e:96:05:ae:b0  
          inet addr:38.124.224.67  Bcast:38.124.224.127  Mask:255.255.255.192
          inet6 addr: fe80::266e:96ff:fe05:aeb0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:80805370 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8423241 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8071366410 (8.0 GB)  TX bytes:1468297158 (1.4 GB)

eno2      Link encap:Ethernet  HWaddr 24:6e:96:05:ae:b2  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eno3      Link encap:Ethernet  HWaddr 24:6e:96:05:ae:b4  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Memory:dae80000-daefffff 

eno4      Link encap:Ethernet  HWaddr 24:6e:96:05:ae:b5  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Memory:daf00000-daf7ffff 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:222 errors:0 dropped:0 overruns:0 frame:0
          TX packets:222 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:21049 (21.0 KB)  TX bytes:21049 (21.0 KB)

virbr0    Link encap:Ethernet  HWaddr 52:54:00:e8:92:ec  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17562 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12619 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2628722 (2.6 MB)  TX bytes:2405500 (2.4 MB)

virbr0-nic Link encap:Ethernet  HWaddr 52:54:00:e8:92:ec  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

vnet0     Link encap:Ethernet  HWaddr fe:54:00:f8:af:b5  
          inet6 addr: fe80::fc54:ff:fef8:afb5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17467 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4431751 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2865065 (2.8 MB)  TX bytes:232190543 (232.1 MB)

vnet1     Link encap:Ethernet  HWaddr fe:54:00:91:95:55  
          inet6 addr: fe80::fc54:ff:fe91:9555/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:95 errors:0 dropped:0 overruns:0 frame:0
          TX packets:70414 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:9525 (9.5 KB)  TX bytes:3686541 (3.6 MB)

And I was assigned the following ip block

Ip block 38.124.224.65/26 
Subnet: 255.255.255.192
Gateway: 38.124.224.65

So when making a bridge called say br0 my currenty /etc/network/interfaces shows

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

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eno1
iface eno1 inet static
        address 38.124.224.67
        netmask 255.255.255.192
        network 38.124.224.64
        broadcast 38.124.224.127
        gateway 38.124.224.65
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 4.2.2.2

Would I simply add to the bottom of this file

auto br0

iface br0 inet static

address 38.124.224.65/26
    netmask 255.255.255.192
    broadcast 38.x.x.x
    dns-nameservers 8.8.8.8 
    bridge_ports eno1
    bridge_stp off
    bridge_fd 0
    bridge_maxwait 0

I'm just unsure if I have to add in each static ip or if I can set a block and it will automatically automatically assign a static to each of the kvms?

nadermx
  • 545
  • 1
    Suggest to do one bridge first, get that working then move to all of them. Suggest this reference for the one. I do not know the answer if you can set a block or not. – Doug Smythies May 01 '18 at 21:13
  • Actually, since you set the IP address for the host in it's interfaces file, you wouldn't set a block there. You would then set each VM's static address within their own interfaces file. – Doug Smythies May 01 '18 at 23:12
  • but then how would i set up the bridge to be able to assign the static ips in each of the vms? With dhcp? Or one static ip? The same static ip of the host macihine? – nadermx May 01 '18 at 23:34
  • You don't. You set the static IP in each VM itself, also telling the VM to use the bridge, and it'll work. Use the reference I gave above, repeating the client (VM) side of it 63 times. Note that you need to keep one IP address for the host, so you can only have 63 VMs (I think, or maybe 62, if you need to keep that gateway IP address free, or even 61 because of the broadcast address). – Doug Smythies May 02 '18 at 03:23
  • By the way it does not make sense to define your block of IP addresses as "38.124.224.65/26", it should be "38.124.224.64/26". But either way it means 38.124.224.64 - 38.124.224.127. – Doug Smythies May 02 '18 at 03:39
  • @DougSmythies Alright, but using your reference would I then append the bridge, or take out my current eno1 from the interfaces file? – nadermx May 02 '18 at 18:49
  • You take it out. – Doug Smythies May 03 '18 at 06:17
  • This worked, if you want can make a answer and I will accept – nadermx May 09 '18 at 05:03
  • Just upvote the reference I gave. – Doug Smythies May 09 '18 at 15:44

0 Answers0