[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-discuss] macvlan, host routing between two different subnets
From: |
Fabrizio Pollastri |
Subject: |
[Qemu-discuss] macvlan, host routing between two different subnets |
Date: |
Thu, 2 Jun 2016 23:27:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 |
Hi,
I am using macvtap/macvlan devices to have full connectivity between
host, guests and outside network.
All is fine and easy when all ips belong to the same subnet.
Unfortunately, my configuration have two subnets, so my question is: is
it possible to have the host machine to perform routing between the two
subnets from packets originating both from inside guests and outside
network?
Let suppose to have the following configuration.
subnet 1 1.1.1.0/24 used for guests and host
subnet 2 2.2.2.0/24 external subnet, secondary address on host eth0
host /etc/network/interfaces:
--------------------------------------
auto eth0
iface eth0 inet static
address 1.1.1.1
netmask 255.255.255.0
gateway 1.1.1.254
auto eth0:0
iface eth0:0 inet static
address 2.2.2.1
netmask 255.255.255.0
auto macvlan0
iface macvlan0 inet manual
pre-up ip route flush default
pre-up ip route flush 1.1.1.0/24
pre-up ip link add link eth0 name macvlan0 type macvlan mode bridge
pre-up ip address add 1.1.1.0/24 dev macvlan0
pre-up ip address add 1.1.1.2/32 dev macvlan0
post-down ip link delete macvlan0
guest /etc/network/interfaces:
----------------------------------------
....
auto eth0
iface eth0 inet static
address 1.1.1.3
netmask 255.255.255.0
gateway 1.1.1.2
...
Thanks for any help.
Fabrizio
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-discuss] macvlan, host routing between two different subnets,
Fabrizio Pollastri <=