KVM network bridge and public static IP for both host and guests
- by Javier Martinez
I have a Debian Server with 4 public static addresses. There is a KVM guest (also Debian) installed and running. What I want is to give the guest an IP of the host, so that both machines have public IPs.
IP 1: 188.165.A.B
IP 2: 178.33.CCC.D
IP 3: 178.33.CCC.E
IP 4: 178.33.CCC.F
What should I do to have connection for host and guest ?
This is network conf:
# ifconfig
br0 Link encap:Ethernet HWaddr e8:40:f2:0a:cc:28
inet addr:188.165.A.B Bcast:188.165.255.255 Mask:255.255.255.0
inet6 addr: fe80::ea40:f2ff:fe0a:cc28/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3618 errors:0 dropped:4 overruns:0 frame:0
TX packets:4853 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:599562 (585.5 KiB) TX bytes:1693443 (1.6 MiB)
eth0 Link encap:Ethernet HWaddr e8:40:f2:0a:cc:28
inet6 addr: fe80::ea40:f2ff:fe0a:cc28/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4274 errors:0 dropped:0 overruns:0 frame:0
TX packets:4879 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:720045 (703.1 KiB) TX bytes:1715641 (1.6 MiB)
Interrupt:20 Memory:fe500000-fe520000
eth0:0 Link encap:Ethernet HWaddr e8:40:f2:0a:cc:28
inet addr:178.33.CCC.D Bcast:178.33.255.255 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:20 Memory:fe500000-fe520000
eth0:1 Link encap:Ethernet HWaddr e8:40:f2:0a:cc:28
inet addr:178.33.CCC.E Bcast:178.33.255.255 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:20 Memory:fe500000-fe520000
eth0:2 Link encap:Ethernet HWaddr e8:40:f2:0a:cc:28
inet addr:178.33.CCC.F Bcast:178.33.255.255 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:20 Memory:fe500000-fe520000
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:16436 Metric:1
RX packets:27932 errors:0 dropped:0 overruns:0 frame:0
TX packets:27932 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1820862 (1.7 MiB) TX bytes:1820862 (1.7 MiB)
vnet0 Link encap:Ethernet HWaddr fe:54:00:87:40:ec
inet6 addr: fe80::fc54:ff:fe87:40ec/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18 errors:0 dropped:0 overruns:0 frame:0
TX packets:204 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:1452 (1.4 KiB) TX bytes:16958 (16.5 KiB)
#route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default aa.bb.cc.eu 0.0.0.0 UG 0 0 0 br0
188.165.255.0 * 255.255.255.0 U 0 0 0 br0
# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.e840f20acc28 no eth0
vnet0
There is no firewall enabled and DNS is configured properly.
What I want to achieve:
| | |
+----+-------------------------+-+------+
| | Host | | |
| | | | |
| | +------------+------+ |
| eth0 | eth0:0-1 | |
| 188.165.A.B | | |
| | | |
| | br0 vnet0 | |
| +------------+------+ |
| | |
| | |
| +------------+------+ |
| | | | |
| | eth0:2-+ | |
| | 178.33.CCC.F | |
| | | |
| | Guest | |
| +-------------------+ |
+---------------------------------------+
Thanks you