Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #227250 > unrolled thread

dhcp bridge for virtual machines using KVM

Started byJames Allsopp <jamesaallsopp@googlemail.com>
First post2020-09-22 18:30 +0200
Last post2020-09-23 13:50 +0200
Articles 12 — 4 participants

Back to article view | Back to linux.debian.user


Contents

  dhcp bridge for virtual machines using KVM James Allsopp <jamesaallsopp@googlemail.com> - 2020-09-22 18:30 +0200
    Re: dhcp bridge for virtual machines using KVM Fabien Roucaute <fabien.roucaute@free.fr> - 2020-09-22 18:50 +0200
      Re: dhcp bridge for virtual machines using KVM Fabien Roucaute <fabien.roucaute@free.fr> - 2020-09-22 19:00 +0200
        Re: dhcp bridge for virtual machines using KVM James Allsopp <jamesaallsopp@googlemail.com> - 2020-09-22 23:00 +0200
          Re: dhcp bridge for virtual machines using KVM Fabien Roucaute <fabien.roucaute@free.fr> - 2020-09-23 07:30 +0200
            Re: dhcp bridge for virtual machines using KVM Fabien Roucaute <fabien.roucaute@free.fr> - 2020-09-23 15:20 +0200
              Re: dhcp bridge for virtual machines using KVM john doe <johndoe65534@mail.com> - 2020-09-23 15:50 +0200
            Re: dhcp bridge for virtual machines using KVM Lucas Castro <lucas@gnuabordo.com.br> - 2020-09-23 16:50 +0200
    Re: dhcp bridge for virtual machines using KVM Lucas Castro <lucas@gnuabordo.com.br> - 2020-09-22 20:50 +0200
      Re: dhcp bridge for virtual machines using KVM James Allsopp <jamesaallsopp@googlemail.com> - 2020-09-22 23:00 +0200
        Re: dhcp bridge for virtual machines using KVM Lucas Castro <lucas@gnuabordo.com.br> - 2020-09-22 23:40 +0200
          Re: dhcp bridge for virtual machines using KVM James Allsopp <jamesaallsopp@googlemail.com> - 2020-09-23 13:50 +0200

#227250 — dhcp bridge for virtual machines using KVM

FromJames Allsopp <jamesaallsopp@googlemail.com>
Date2020-09-22 18:30 +0200
Subjectdhcp bridge for virtual machines using KVM
Message-ID<ARTkZ-3uq-1@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

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;

<network>
  <name>host-bridge</name>
  <forward mode="bridge"/>
  <bridge name="br0"/>
</network>

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

[toc] | [next] | [standalone]


#227251

FromFabien Roucaute <fabien.roucaute@free.fr>
Date2020-09-22 18:50 +0200
Message-ID<ARTEl-3AR-1@gated-at.bofh.it>
In reply to#227250
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;
> 
> <network>
>   <name>host-bridge</name>
>   <forward mode="bridge"/>
>   <bridge name="br0"/>
> </network>
> 
> 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.

[toc] | [prev] | [next] | [standalone]


#227252

FromFabien Roucaute <fabien.roucaute@free.fr>
Date2020-09-22 19:00 +0200
Message-ID<ARTO1-3E2-3@gated-at.bofh.it>
In reply to#227251
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'

[toc] | [prev] | [next] | [standalone]


#227260

FromJames Allsopp <jamesaallsopp@googlemail.com>
Date2020-09-22 23:00 +0200
Message-ID<ARXyi-5Tb-5@gated-at.bofh.it>
In reply to#227252

[Multipart message — attachments visible in raw view] — view raw

On Tue, 22 Sep 2020 at 17:58, Fabien Roucaute <fabien.roucaute@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: <LOOPBACK,UP,LOWER_UP> 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: <NO-CARRIER,BROADCAST,MULTICAST,UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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: <NO-CARRIER,BROADCAST,MULTICAST,UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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

[toc] | [prev] | [next] | [standalone]


#227266

FromFabien Roucaute <fabien.roucaute@free.fr>
Date2020-09-23 07:30 +0200
Message-ID<AS5vP-2pi-3@gated-at.bofh.it>
In reply to#227260
Le 22/09/2020 à 22:57, James Allsopp a écrit :
> 
> 
> On Tue, 22 Sep 2020 at 17:58, Fabien Roucaute <fabien.roucaute@free.fr
> <mailto:fabien.roucaute@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: <LOOPBACK,UP,LOWER_UP> 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 <http://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: <NO-CARRIER,BROADCAST,MULTICAST,UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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 <http://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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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 <http://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: <NO-CARRIER,BROADCAST,MULTICAST,UP> 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 <http://172.17.0.1/16> brd 172.17.255.255 scope
> global docker0
>        valid_lft forever preferred_lft forever
> 8: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> 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.

[toc] | [prev] | [next] | [standalone]


#227270

FromFabien Roucaute <fabien.roucaute@free.fr>
Date2020-09-23 15:20 +0200
Message-ID<AScQF-6OE-1@gated-at.bofh.it>
In reply to#227266
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 <http://172.17.0.0/16> dev docker0 proto kernel scope link
> src 172.17.0.1 linkdown
> 192.168.1.0/24 <http://192.168.1.0/24> dev br0 proto kernel scope link
> src 192.168.1.206
> 192.168.1.0/24 <http://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.

[toc] | [prev] | [next] | [standalone]


#227271

Fromjohn doe <johndoe65534@mail.com>
Date2020-09-23 15:50 +0200
Message-ID<ASdjH-6YD-1@gated-at.bofh.it>
In reply to#227270
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 <http://172.17.0.0/16> dev docker0 proto kernel scope link
>> src 172.17.0.1 linkdown
>> 192.168.1.0/24 <http://192.168.1.0/24> dev br0 proto kernel scope link
>> src 192.168.1.206
>> 192.168.1.0/24 <http://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

[toc] | [prev] | [next] | [standalone]


#227272

FromLucas Castro <lucas@gnuabordo.com.br>
Date2020-09-23 16:50 +0200
Message-ID<ASefL-7xQ-1@gated-at.bofh.it>
In reply to#227266
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 <fabien.roucaute@free.fr
>> <mailto:fabien.roucaute@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: <LOOPBACK,UP,LOWER_UP> 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 <http://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: <NO-CARRIER,BROADCAST,MULTICAST,UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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 <http://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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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 <http://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: <NO-CARRIER,BROADCAST,MULTICAST,UP> 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 <http://172.17.0.1/16> brd 172.17.255.255 scope
>> global docker0
>>         valid_lft forever preferred_lft forever
>> 8: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> 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

[toc] | [prev] | [next] | [standalone]


#227254

FromLucas Castro <lucas@gnuabordo.com.br>
Date2020-09-22 20:50 +0200
Message-ID<ARVwt-4IV-1@gated-at.bofh.it>
In reply to#227250
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;
>
> <network>
>   <name>host-bridge</name>
>   <forward mode="bridge"/>
>   <bridge name="br0"/>
> </network>
>
> 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

[toc] | [prev] | [next] | [standalone]


#227258

FromJames Allsopp <jamesaallsopp@googlemail.com>
Date2020-09-22 23:00 +0200
Message-ID<ARXyi-5Tb-3@gated-at.bofh.it>
In reply to#227254

[Multipart message — attachments visible in raw view] — view raw

On Tue, 22 Sep 2020 at 19:47, Lucas Castro <lucas@gnuabordo.com.br> 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;
> >
> > <network>
> >   <name>host-bridge</name>
> >   <forward mode="bridge"/>
> >   <bridge name="br0"/>
> > </network>
> >
> > 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
>
>

[toc] | [prev] | [next] | [standalone]


#227262

FromLucas Castro <lucas@gnuabordo.com.br>
Date2020-09-22 23:40 +0200
Message-ID<ARYb0-6l2-5@gated-at.bofh.it>
In reply to#227258

[Multipart message — attachments visible in raw view] — view raw

On 9/22/20 5:54 PM, James Allsopp wrote:
>
>
> On Tue, 22 Sep 2020 at 19:47, Lucas Castro <lucas@gnuabordo.com.br 
> <mailto:lucas@gnuabordo.com.br>> 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;
>     >
>     > <network>
>     >   <name>host-bridge</name>
>     >   <forward mode="bridge"/>
>     >   <bridge name="br0"/>
>     > </network>
>
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"
     <interface type='network'>
       <mac address='52:54:00:1b:07:7c'/>
       <source network='default' bridge='virbr0'/>
       <target dev='vnet0'/>
       <model type='virtio'/>
       <alias name='net0'/>
       <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 
function='0x0'/>
     </interface>
     <interface type='bridge'>
       <mac address='52:54:00:7c:96:61'/>
       <source bridge='lxc-lan'/>
       <target dev='vnet1'/>
       <model type='virtio'/>
       <alias name='net1'/>
       <address type='pci' domain='0x0000' bus='0x07' slot='0x00' 
function='0x0'/>
     </interface>

>     >
>     > 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

[toc] | [prev] | [next] | [standalone]


#227269

FromJames Allsopp <jamesaallsopp@googlemail.com>
Date2020-09-23 13:50 +0200
Message-ID<ASbrz-5R3-1@gated-at.bofh.it>
In reply to#227262

[Multipart message — attachments visible in raw view] — view raw

On Tue, 22 Sep 2020 at 22:30, Lucas Castro <lucas@gnuabordo.com.br> wrote:

>
> On 9/22/20 5:54 PM, James Allsopp wrote:
>
>
>
> On Tue, 22 Sep 2020 at 19:47, Lucas Castro <lucas@gnuabordo.com.br> 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;
>> >
>> > <network>
>> >   <name>host-bridge</name>
>> >   <forward mode="bridge"/>
>> >   <bridge name="br0"/>
>> > </network>
>>
> 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"
>     <interface type='network'>
>       <mac address='52:54:00:1b:07:7c'/>
>       <source network='default' bridge='virbr0'/>
>       <target dev='vnet0'/>
>       <model type='virtio'/>
>       <alias name='net0'/>
>       <address type='pci' domain='0x0000' bus='0x01' slot='0x00'
> function='0x0'/>
>     </interface>
>     <interface type='bridge'>
>       <mac address='52:54:00:7c:96:61'/>
>       <source bridge='lxc-lan'/>
>       <target dev='vnet1'/>
>       <model type='virtio'/>
>       <alias name='net1'/>
>       <address type='pci' domain='0x0000' bus='0x07' slot='0x00'
> function='0x0'/>
>     </interface>
>
> >
>> > 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"
    <interface type='bridge'>
      <mac address='52:54:00:8a:6e:57'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>

 12:40:09 pm BST  james  BigRaid 
❱ virsh -c qemu:///system dumpxml debian10 | egrep -A5 -i "network|bridge"
    <interface type='bridge'>
      <mac address='52:54:00:f8:30:32'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00'
function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
 Thanks
James

> --
> Lucas Castro
>
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web