Re: dhcp bridge for virtual machines using KVM

2020-09-23 Thread Lucas Castro



On 9/23/20 2:25 AM, Fabien Roucaute wrote:

Le 22/09/2020 à 22:57, James Allsopp a écrit :


On Tue, 22 Sep 2020 at 17:58, Fabien Roucaute mailto:fabien.rouca...@free.fr>> wrote:

 Le 22/09/2020 à 18:50, James Allsopp a écrit :
 >
 > I've tried that but I get the same result.
 > Thanks
 > James
 >

 You need to answer to the mailing-list email address, not mine.
 If it still doesn't work, we need more information, like the result of
 the following commands (you should modify the public IP that appears in
 if it's the case)
 'ip a'
 'iptables-save'
 'brctl show'


Here's ip a
  ip a
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN
group default qlen 1000
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
     inet 127.0.0.1/8  scope host lo
        valid_lft forever preferred_lft forever
     inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc pfifo_fast
state DOWN group default qlen 1000
     link/ether 00:1d:7d:0d:2a:9f brd ff:ff:ff:ff:ff:ff
3: eth1:  mtu 1500 qdisc pfifo_fast
master br0 state UP group default qlen 1000
     link/ether 00:1d:7d:0d:2a:9d brd ff:ff:ff:ff:ff:ff
4: wlan0:  mtu 1500 qdisc noqueue state
UP group default qlen 1000
     link/ether b4:ee:b4:84:37:2a brd ff:ff:ff:ff:ff:ff
     inet 192.168.1.174/24  brd 192.168.1.255
scope global dynamic noprefixroute wlan0
        valid_lft 27656sec preferred_lft 27656sec
     inet6 fde6:4511:f54::a55/128 scope global noprefixroute
        valid_lft forever preferred_lft forever
     inet6 fde6:4511:f54:0:f195:8361:215d:5f17/64 scope global noprefixroute
        valid_lft forever preferred_lft forever
     inet6 fe80::4bf0:ca57:25f0:ed7f/64 scope link noprefixroute
        valid_lft forever preferred_lft forever
5: br0:  mtu 1500 qdisc noqueue state
UP group default qlen 1000
     link/ether 00:1d:7d:0d:2a:9d brd ff:ff:ff:ff:ff:ff
     inet 192.168.1.206/24  brd 192.168.1.255
scope global dynamic br0
        valid_lft 27655sec preferred_lft 27655sec
     inet6 fde6:4511:f54:0:21d:7dff:fe0d:2a9d/64 scope global dynamic


Is there a physical interface attached in on your bridge?

What 'brctl show' return?


mngtmpaddr
        valid_lft forever preferred_lft forever
     inet6 fe80::21d:7dff:fe0d:2a9d/64 scope link
        valid_lft forever preferred_lft forever
6: docker0:  mtu 1500 qdisc noqueue
state DOWN group default
     link/ether 02:42:12:5f:1a:5e brd ff:ff:ff:ff:ff:ff
     inet 172.17.0.1/16  brd 172.17.255.255 scope
global docker0
        valid_lft forever preferred_lft forever
8: vnet0:  mtu 1500 qdisc pfifo_fast
master br0 state UNKNOWN group default qlen 1000
     link/ether fe:54:00:8a:6e:57 brd ff:ff:ff:ff:ff:ff
     inet6 fe80::fc54:ff:fe8a:6e57/64 scope link
        valid_lft forever preferred_lft forever


Here's iptables -L
  iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy DROP)
target     prot opt source               destination
DOCKER-USER  all  --  anywhere             anywhere
DOCKER-ISOLATION-STAGE-1  all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere             ctstate
RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain DOCKER (1 references)
target     prot opt source               destination

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target     prot opt source               destination
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere
RETURN     all  --  anywhere             anywhere

Chain DOCKER-ISOLATION-STAGE-2 (1 references)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere
RETURN     all  --  anywhere             anywhere

Chain DOCKER-USER (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

and brctl show

bridge name     bridge id               STP enabled     interfaces
br0             8000.001d7d0d2a9d       no              eth1
                                                         vnet0
docker0         8000.0242125f1a5e       no

Thanks!
James

I forgot to ask for the routing table, could you post the result of 'ip
r' ? Otherwise, can I ask why you think you need a Wifi connection and
wired one but assigned to them ip addresses that are in the same subnet?
Because you can access the host and the VMs on different IPs with only
the wired NIC.


--
Lucas Castro



Re: dhcp bridge for virtual machines using KVM

2020-09-23 Thread john doe

On 9/23/2020 3:14 PM, Fabien Roucaute wrote:

Le 23/09/2020 à 13:50, James Allsopp a écrit :


Yes, it's a bit odd,but the reason I want to do it like this is that the
wifi is pretty fast and the ethernet is constrained by powerline
networking to about 50Mbps. However, I can't run a bridge over the wifi,
so I'm trying to run all the host activity over the wifi and reserve the
ethernet just for the vm bridge.

In answer to your question;
❱ ip r
default via 192.168.1.1 dev br0
default via 192.168.1.1 dev wlan0 proto dhcp metric 600
172.17.0.0/16  dev docker0 proto kernel scope link
src 172.17.0.1 linkdown
192.168.1.0/24  dev br0 proto kernel scope link
src 192.168.1.206
192.168.1.0/24  dev wlan0 proto kernel scope link
src 192.168.1.174 metric 600

Thanks
James


You really should answer to the list email address ;)
The only problem he can see is that the vnet0 interface seems to be tied
to the bridge br0, it seems odd and it could be the cause of the problem
even if I'm not 100% sure. Try to delete the virtual network named
'host-bridge'. And where did you bind the "bridge" in the forward mode
for a virtual network? I can't find it in the libvirt documentation.



Try to install a VM with '--bridge=br0' and see if it works there.

--
John Doe



Re: dhcp bridge for virtual machines using KVM

2020-09-23 Thread Fabien Roucaute
Le 23/09/2020 à 13:50, James Allsopp a écrit :

> Yes, it's a bit odd,but the reason I want to do it like this is that the
> wifi is pretty fast and the ethernet is constrained by powerline
> networking to about 50Mbps. However, I can't run a bridge over the wifi,
> so I'm trying to run all the host activity over the wifi and reserve the
> ethernet just for the vm bridge.
> 
> In answer to your question;
> ❱ ip r                                                                    
> default via 192.168.1.1 dev br0
> default via 192.168.1.1 dev wlan0 proto dhcp metric 600
> 172.17.0.0/16  dev docker0 proto kernel scope link
> src 172.17.0.1 linkdown
> 192.168.1.0/24  dev br0 proto kernel scope link
> src 192.168.1.206
> 192.168.1.0/24  dev wlan0 proto kernel scope link
> src 192.168.1.174 metric 600
> 
> Thanks
> James

You really should answer to the list email address ;)
The only problem he can see is that the vnet0 interface seems to be tied
to the bridge br0, it seems odd and it could be the cause of the problem
even if I'm not 100% sure. Try to delete the virtual network named
'host-bridge'. And where did you bind the "bridge" in the forward mode
for a virtual network? I can't find it in the libvirt documentation.



Re: dhcp bridge for virtual machines using KVM

2020-09-23 Thread James Allsopp
On Tue, 22 Sep 2020 at 22:30, Lucas Castro  wrote:

>
> On 9/22/20 5:54 PM, James Allsopp wrote:
>
>
>
> On Tue, 22 Sep 2020 at 19:47, Lucas Castro  wrote:
>
>>
>> On 9/22/20 1:26 PM, James Allsopp wrote:
>> > Hi,
>> > I've got a computer that I'm running debian 10 on with KVM. The
>> > machine is connected to a OpenWRT router which provides DHCP and DNS
>> > to the network, via a wifi link used for the host and an ethernet
>> > connection on eth1 used for a bridge
>>
>> Is your OpenWRT router running in vm on the same host or somewhere else
>> throughout physical network eth1?
>>
>>
> The OpenWRT is a completely separate device running at the end of the
> cable connected to eth1. The Wireless is also connected to an AP on that
> router. All of this is on the 192.168.1.* network.
>
>
>
>> >
>> > I've set this file up for the bridge in /etc/network/interfaces.d/br0
>> > auto eth1
>> > auto br0
>> > iface br0 inet dhcp
>> > bridge_ports eth1
>> > bridge_fd 0
>> > bridge_stp off
>> >
>> > ifup br0 brought it up nicely and it got an IP address in the range
>> > I'd expect. So far so good. The only problem is now, I can't get any
>> > of the VM's I create to use this network. When creating a VM using
>> > Virtual Machine Manager, it gives me the option to specify shared
>> > device name for the network source. One of these is for a network I
>> > already created in virsh;
>> >
>> > 
>> >   host-bridge
>> >   
>> >   
>> > 
>>
> Try something like this ti get your vm settings.
>
> virsh -c qemu:///system dumpxml ${GUEST_NAME} | egrep -A5 -i
> "network|bridge"
>
>
> i.e.
>
> virsh -c qemu:///system dumpxml Buster | egrep -A5 -i "network|bridge"
> 
>   
>   
>   
>   
>   
>function='0x0'/>
> 
> 
>   
>   
>   
>   
>   
>function='0x0'/>
> 
>
> >
>> > However, if I set the network to either 'host-bridge' or br0 directly,
>> > the route is never set and I can never get  a dhcp setting. I've
>> > checked ip_forward is set to 1.
>> >
>> > I'd just like to set it up this way, as it seems really inefficient to
>> > have a dhcp and then use difficult to remember static IP's everywhere.
>> >
>> > Thanks
>> > James
>> >
>> >
>> --
>> Lucas Castro
>>
>> Here's what I get;
 virsh -c qemu:///system dumpxml proxy1 | egrep -A5 -i "network|bridge"

  
  
  
  


  

 12:40:09 pm BST  james  BigRaid 
❱ virsh -c qemu:///system dumpxml debian10 | egrep -A5 -i "network|bridge"

  
  
  
  


  
 Thanks
James

> --
> Lucas Castro
>
>


Re: dhcp bridge for virtual machines using KVM

2020-09-22 Thread Fabien Roucaute
Le 22/09/2020 à 22:57, James Allsopp a écrit :
> 
> 
> On Tue, 22 Sep 2020 at 17:58, Fabien Roucaute  > wrote:
> 
> Le 22/09/2020 à 18:50, James Allsopp a écrit :
> >
> > I've tried that but I get the same result.
> > Thanks
> > James
> >
> 
> You need to answer to the mailing-list email address, not mine.
> If it still doesn't work, we need more information, like the result of
> the following commands (you should modify the public IP that appears in
> if it's the case)
> 'ip a'
> 'iptables-save'
> 'brctl show'
> 
> 
> Here's ip a
>  ip a
> 1: lo:  mtu 65536 qdisc noqueue state UNKNOWN
> group default qlen 1000
>     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>     inet 127.0.0.1/8  scope host lo
>        valid_lft forever preferred_lft forever
>     inet6 ::1/128 scope host
>        valid_lft forever preferred_lft forever
> 2: eth0:  mtu 1500 qdisc pfifo_fast
> state DOWN group default qlen 1000
>     link/ether 00:1d:7d:0d:2a:9f brd ff:ff:ff:ff:ff:ff
> 3: eth1:  mtu 1500 qdisc pfifo_fast
> master br0 state UP group default qlen 1000
>     link/ether 00:1d:7d:0d:2a:9d brd ff:ff:ff:ff:ff:ff
> 4: wlan0:  mtu 1500 qdisc noqueue state
> UP group default qlen 1000
>     link/ether b4:ee:b4:84:37:2a brd ff:ff:ff:ff:ff:ff
>     inet 192.168.1.174/24  brd 192.168.1.255
> scope global dynamic noprefixroute wlan0
>        valid_lft 27656sec preferred_lft 27656sec
>     inet6 fde6:4511:f54::a55/128 scope global noprefixroute
>        valid_lft forever preferred_lft forever
>     inet6 fde6:4511:f54:0:f195:8361:215d:5f17/64 scope global noprefixroute
>        valid_lft forever preferred_lft forever
>     inet6 fe80::4bf0:ca57:25f0:ed7f/64 scope link noprefixroute
>        valid_lft forever preferred_lft forever
> 5: br0:  mtu 1500 qdisc noqueue state
> UP group default qlen 1000
>     link/ether 00:1d:7d:0d:2a:9d brd ff:ff:ff:ff:ff:ff
>     inet 192.168.1.206/24  brd 192.168.1.255
> scope global dynamic br0
>        valid_lft 27655sec preferred_lft 27655sec
>     inet6 fde6:4511:f54:0:21d:7dff:fe0d:2a9d/64 scope global dynamic
> mngtmpaddr
>        valid_lft forever preferred_lft forever
>     inet6 fe80::21d:7dff:fe0d:2a9d/64 scope link
>        valid_lft forever preferred_lft forever
> 6: docker0:  mtu 1500 qdisc noqueue
> state DOWN group default
>     link/ether 02:42:12:5f:1a:5e brd ff:ff:ff:ff:ff:ff
>     inet 172.17.0.1/16  brd 172.17.255.255 scope
> global docker0
>        valid_lft forever preferred_lft forever
> 8: vnet0:  mtu 1500 qdisc pfifo_fast
> master br0 state UNKNOWN group default qlen 1000
>     link/ether fe:54:00:8a:6e:57 brd ff:ff:ff:ff:ff:ff
>     inet6 fe80::fc54:ff:fe8a:6e57/64 scope link
>        valid_lft forever preferred_lft forever
> 
> 
> Here's iptables -L
>  iptables -L
> Chain INPUT (policy ACCEPT)
> target     prot opt source               destination        
> 
> Chain FORWARD (policy DROP)
> target     prot opt source               destination        
> DOCKER-USER  all  --  anywhere             anywhere            
> DOCKER-ISOLATION-STAGE-1  all  --  anywhere             anywhere            
> ACCEPT     all  --  anywhere             anywhere             ctstate
> RELATED,ESTABLISHED
> DOCKER     all  --  anywhere             anywhere            
> ACCEPT     all  --  anywhere             anywhere            
> ACCEPT     all  --  anywhere             anywhere            
> 
> Chain OUTPUT (policy ACCEPT)
> target     prot opt source               destination        
> 
> Chain DOCKER (1 references)
> target     prot opt source               destination        
> 
> Chain DOCKER-ISOLATION-STAGE-1 (1 references)
> target     prot opt source               destination        
> DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere            
> RETURN     all  --  anywhere             anywhere            
> 
> Chain DOCKER-ISOLATION-STAGE-2 (1 references)
> target     prot opt source               destination        
> DROP       all  --  anywhere             anywhere            
> RETURN     all  --  anywhere             anywhere            
> 
> Chain DOCKER-USER (1 references)
> target     prot opt source               destination        
> RETURN     all  --  anywhere             anywhere     
> 
> and brctl show
> 
> bridge name     bridge id               STP enabled     interfaces
> br0             8000.001d7d0d2a9d       no              eth1
>                                                         vnet0
> docker0         8000.0242125f1a5e       no
> 
> Thanks!
> James

I forgot to ask for the routing table, could you post the result of 'ip
r' ? Otherwise, can I ask why you think you need a Wifi connection and
wired one but assigned to them ip addresses that are in the same subnet?
Because you can access the host and the VMs on different IPs with only
the wired NIC.



Re: dhcp bridge for virtual machines using KVM

2020-09-22 Thread Lucas Castro


On 9/22/20 5:54 PM, James Allsopp wrote:



On Tue, 22 Sep 2020 at 19:47, Lucas Castro > wrote:



On 9/22/20 1:26 PM, James Allsopp wrote:
> Hi,
> I've got a computer that I'm running debian 10 on with KVM. The
> machine is connected to a OpenWRT router which provides DHCP and
DNS
> to the network, via a wifi link used for the host and an ethernet
> connection on eth1 used for a bridge

Is your OpenWRT router running in vm on the same host or somewhere
else
throughout physical network eth1?


The OpenWRT is a completely separate device running at the end of the 
cable connected to eth1. The Wireless is also connected to an AP on 
that router. All of this is on the 192.168.1.* network.


>
> I've set this file up for the bridge in
/etc/network/interfaces.d/br0
> auto eth1
> auto br0
> iface br0 inet dhcp
> bridge_ports eth1
> bridge_fd 0
> bridge_stp off
>
> ifup br0 brought it up nicely and it got an IP address in the range
> I'd expect. So far so good. The only problem is now, I can't get
any
> of the VM's I create to use this network. When creating a VM using
> Virtual Machine Manager, it gives me the option to specify shared
> device name for the network source. One of these is for a network I
> already created in virsh;
>
> 
>   host-bridge
>   
>   
> 


Try something like this ti get your vm settings.

virsh -c qemu:///system dumpxml ${GUEST_NAME} | egrep -A5 -i 
"network|bridge"



i.e.

virsh -c qemu:///system dumpxml Buster | egrep -A5 -i "network|bridge"
    
  
  
  
  
  
  function='0x0'/>

    
    
  
  
  
  
  
  function='0x0'/>

    


>
> However, if I set the network to either 'host-bridge' or br0
directly,
> the route is never set and I can never get  a dhcp setting. I've
> checked ip_forward is set to 1.
>
> I'd just like to set it up this way, as it seems really
inefficient to
> have a dhcp and then use difficult to remember static IP's
everywhere.
>
> Thanks
> James
>
>
-- 
Lucas Castro



--
Lucas Castro



Re: dhcp bridge for virtual machines using KVM

2020-09-22 Thread James Allsopp
On Tue, 22 Sep 2020 at 17:58, Fabien Roucaute 
wrote:

> Le 22/09/2020 à 18:50, James Allsopp a écrit :
> >
> > I've tried that but I get the same result.
> > Thanks
> > James
> >
>
> You need to answer to the mailing-list email address, not mine.
> If it still doesn't work, we need more information, like the result of
> the following commands (you should modify the public IP that appears in
> if it's the case)
> 'ip a'
> 'iptables-save'
> 'brctl show'
>
>
Here's ip a
 ip a
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group
default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
   valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc pfifo_fast
state DOWN group default qlen 1000
link/ether 00:1d:7d:0d:2a:9f brd ff:ff:ff:ff:ff:ff
3: eth1:  mtu 1500 qdisc pfifo_fast master
br0 state UP group default qlen 1000
link/ether 00:1d:7d:0d:2a:9d brd ff:ff:ff:ff:ff:ff
4: wlan0:  mtu 1500 qdisc noqueue state UP
group default qlen 1000
link/ether b4:ee:b4:84:37:2a brd ff:ff:ff:ff:ff:ff
inet 192.168.1.174/24 brd 192.168.1.255 scope global dynamic
noprefixroute wlan0
   valid_lft 27656sec preferred_lft 27656sec
inet6 fde6:4511:f54::a55/128 scope global noprefixroute
   valid_lft forever preferred_lft forever
inet6 fde6:4511:f54:0:f195:8361:215d:5f17/64 scope global noprefixroute
   valid_lft forever preferred_lft forever
inet6 fe80::4bf0:ca57:25f0:ed7f/64 scope link noprefixroute
   valid_lft forever preferred_lft forever
5: br0:  mtu 1500 qdisc noqueue state UP
group default qlen 1000
link/ether 00:1d:7d:0d:2a:9d brd ff:ff:ff:ff:ff:ff
inet 192.168.1.206/24 brd 192.168.1.255 scope global dynamic br0
   valid_lft 27655sec preferred_lft 27655sec
inet6 fde6:4511:f54:0:21d:7dff:fe0d:2a9d/64 scope global dynamic
mngtmpaddr
   valid_lft forever preferred_lft forever
inet6 fe80::21d:7dff:fe0d:2a9d/64 scope link
   valid_lft forever preferred_lft forever
6: docker0:  mtu 1500 qdisc noqueue
state DOWN group default
link/ether 02:42:12:5f:1a:5e brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
   valid_lft forever preferred_lft forever
8: vnet0:  mtu 1500 qdisc pfifo_fast
master br0 state UNKNOWN group default qlen 1000
link/ether fe:54:00:8a:6e:57 brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc54:ff:fe8a:6e57/64 scope link
   valid_lft forever preferred_lft forever


Here's iptables -L
 iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source   destination

Chain FORWARD (policy DROP)
target prot opt source   destination
DOCKER-USER  all  --  anywhere anywhere
DOCKER-ISOLATION-STAGE-1  all  --  anywhere anywhere
ACCEPT all  --  anywhere anywhere ctstate
RELATED,ESTABLISHED
DOCKER all  --  anywhere anywhere
ACCEPT all  --  anywhere anywhere
ACCEPT all  --  anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source   destination

Chain DOCKER (1 references)
target prot opt source   destination

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target prot opt source   destination
DOCKER-ISOLATION-STAGE-2  all  --  anywhere anywhere
RETURN all  --  anywhere anywhere

Chain DOCKER-ISOLATION-STAGE-2 (1 references)
target prot opt source   destination
DROP   all  --  anywhere anywhere
RETURN all  --  anywhere anywhere

Chain DOCKER-USER (1 references)
target prot opt source   destination
RETURN all  --  anywhere anywhere

and brctl show

bridge name bridge id   STP enabled interfaces
br0 8000.001d7d0d2a9d   no  eth1
vnet0
docker0 8000.0242125f1a5e   no

Thanks!
James


Re: dhcp bridge for virtual machines using KVM

2020-09-22 Thread James Allsopp
On Tue, 22 Sep 2020 at 19:47, Lucas Castro  wrote:

>
> On 9/22/20 1:26 PM, James Allsopp wrote:
> > Hi,
> > I've got a computer that I'm running debian 10 on with KVM. The
> > machine is connected to a OpenWRT router which provides DHCP and DNS
> > to the network, via a wifi link used for the host and an ethernet
> > connection on eth1 used for a bridge
>
> Is your OpenWRT router running in vm on the same host or somewhere else
> throughout physical network eth1?
>
>
The OpenWRT is a completely separate device running at the end of the cable
connected to eth1. The Wireless is also connected to an AP on that router.
All of this is on the 192.168.1.* network.



> >
> > I've set this file up for the bridge in /etc/network/interfaces.d/br0
> > auto eth1
> > auto br0
> > iface br0 inet dhcp
> > bridge_ports eth1
> > bridge_fd 0
> > bridge_stp off
> >
> > ifup br0 brought it up nicely and it got an IP address in the range
> > I'd expect. So far so good. The only problem is now, I can't get any
> > of the VM's I create to use this network. When creating a VM using
> > Virtual Machine Manager, it gives me the option to specify shared
> > device name for the network source. One of these is for a network I
> > already created in virsh;
> >
> > 
> >   host-bridge
> >   
> >   
> > 
> >
> > However, if I set the network to either 'host-bridge' or br0 directly,
> > the route is never set and I can never get  a dhcp setting. I've
> > checked ip_forward is set to 1.
> >
> > I'd just like to set it up this way, as it seems really inefficient to
> > have a dhcp and then use difficult to remember static IP's everywhere.
> >
> > Thanks
> > James
> >
> >
> --
> Lucas Castro
>
>


Re: dhcp bridge for virtual machines using KVM

2020-09-22 Thread Lucas Castro



On 9/22/20 1:26 PM, James Allsopp wrote:

Hi,
I've got a computer that I'm running debian 10 on with KVM. The 
machine is connected to a OpenWRT router which provides DHCP and DNS 
to the network, via a wifi link used for the host and an ethernet 
connection on eth1 used for a bridge


Is your OpenWRT router running in vm on the same host or somewhere else 
throughout physical network eth1?





I've set this file up for the bridge in /etc/network/interfaces.d/br0
auto eth1
auto br0
iface br0 inet dhcp
bridge_ports eth1
bridge_fd 0
bridge_stp off

ifup br0 brought it up nicely and it got an IP address in the range 
I'd expect. So far so good. The only problem is now, I can't get any 
of the VM's I create to use this network. When creating a VM using 
Virtual Machine Manager, it gives me the option to specify shared 
device name for the network source. One of these is for a network I 
already created in virsh;



  host-bridge
  
  


However, if I set the network to either 'host-bridge' or br0 directly, 
the route is never set and I can never get  a dhcp setting. I've 
checked ip_forward is set to 1.


I'd just like to set it up this way, as it seems really inefficient to 
have a dhcp and then use difficult to remember static IP's everywhere.


Thanks
James



--
Lucas Castro



Re: dhcp bridge for virtual machines using KVM

2020-09-22 Thread Fabien Roucaute
Le 22/09/2020 à 18:50, James Allsopp a écrit :
> 
> I've tried that but I get the same result.
> Thanks
> James
> 

You need to answer to the mailing-list email address, not mine.
If it still doesn't work, we need more information, like the result of
the following commands (you should modify the public IP that appears in
if it's the case)
'ip a'
'iptables-save'
'brctl show'



Re: dhcp bridge for virtual machines using KVM

2020-09-22 Thread Fabien Roucaute
Le 22/09/2020 à 18:26, James Allsopp a écrit :
> Hi,
> I've got a computer that I'm running debian 10 on with KVM. The machine
> is connected to a OpenWRT router which provides DHCP and DNS to the
> network, via a wifi link used for the host and an ethernet connection on
> eth1 used for a bridge
> 
> I've set this file up for the bridge in /etc/network/interfaces.d/br0
> auto eth1
> auto br0
> iface br0 inet dhcp
> bridge_ports eth1
> bridge_fd 0
> bridge_stp off
> 
> ifup br0 brought it up nicely and it got an IP address in the range I'd
> expect. So far so good. The only problem is now, I can't get any of the
> VM's I create to use this network. When creating a VM using Virtual
> Machine Manager, it gives me the option to specify shared device name
> for the network source. One of these is for a network I already created
> in virsh;
> 
> 
>   host-bridge
>   
>   
> 
> 
> However, if I set the network to either 'host-bridge' or br0 directly,
> the route is never set and I can never get  a dhcp setting. I've checked
> ip_forward is set to 1.
> 
> I'd just like to set it up this way, as it seems really inefficient to
> have a dhcp and then use difficult to remember static IP's everywhere.
> 
> Thanks
> James
> 
> 
You don't need to create a virtual network to 'plug' your vm on the
brigde using the host NIC. Just select the br0 bridge as the source on
the VM's NIC hardware settting.



dhcp bridge for virtual machines using KVM

2020-09-22 Thread James Allsopp
Hi,
I've got a computer that I'm running debian 10 on with KVM. The machine is
connected to a OpenWRT router which provides DHCP and DNS to the network,
via a wifi link used for the host and an ethernet connection on eth1 used
for a bridge

I've set this file up for the bridge in /etc/network/interfaces.d/br0
auto eth1
auto br0
iface br0 inet dhcp
bridge_ports eth1
bridge_fd 0
bridge_stp off

ifup br0 brought it up nicely and it got an IP address in the range I'd
expect. So far so good. The only problem is now, I can't get any of the
VM's I create to use this network. When creating a VM using Virtual Machine
Manager, it gives me the option to specify shared device name for the
network source. One of these is for a network I already created in virsh;


  host-bridge
  
  


However, if I set the network to either 'host-bridge' or br0 directly, the
route is never set and I can never get  a dhcp setting. I've checked
ip_forward is set to 1.

I'd just like to set it up this way, as it seems really inefficient to have
a dhcp and then use difficult to remember static IP's everywhere.

Thanks
James