Re: [libvirt-users] connecting host and guest vm using a dummy nic

2018-05-03 Thread daggs
Greetings Laine,

> Sent: Thursday, May 03, 2018 at 9:39 AM
> From: daggs 
> To: "Laine Stump" 
> Cc: libvirt-users@redhat.com
> Subject: Re: [libvirt-users] connecting host and guest vm using a dummy nic
>
> Greetings Laine,
> 
> > Sent: Thursday, May 03, 2018 at 1:13 AM
> > From: "Laine Stump" 
> > To: libvirt-users@redhat.com
> > Cc: daggs 
> > Subject: Re: [libvirt-users] connecting host and guest vm using a dummy nic
> >
> > On 05/02/2018 01:28 PM, daggs wrote:
> > 
> > >> Sent: Wednesday, May 02, 2018 at 8:09 PM
> > >> From: "Laine Stump" 
> > 
> > >>
> > >> Also, if virtio works, then *definitely* use that instead of e1000 - the
> > >> performance will be much better and overhead much lower.
> > >>
> > >>
> > > so any network test will do?
> > > 
> > 
> > 
> > Do you mean to test and see if virtio-net is acceptable for your guest
> > OS? If the guest OS has the driver for virtio-net, then definitely you
> > should use it. I've never heard of a case of any of the drivers that
> > emulate real hardware performing anywhere near as well as virtio-net.
> > 
> 
> no, I mean test the virtual nic speed, will ipref work?
> also, in the guest os, the module attached to the virtual nic is virtio-pci, 
> is that expected?
> 
> ___
> libvirt-users mailing list
> libvirt-users@redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users
> 

root@router:/# iperf -s

Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)

[  4] local 10.1.0.138 port 5001 connected with 10.1.0.212 port 57590
[ ID] Interval   Transfer Bandwidth
[  4]  0.0-10.0 sec  33.1 GBytes  28.4 Gbits/sec

looks very good indeed. thanks for all the help.

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] connecting host and guest vm using a dummy nic

2018-05-02 Thread daggs
Greetings Laine,

> Sent: Thursday, May 03, 2018 at 1:13 AM
> From: "Laine Stump" 
> To: libvirt-users@redhat.com
> Cc: daggs 
> Subject: Re: [libvirt-users] connecting host and guest vm using a dummy nic
>
> On 05/02/2018 01:28 PM, daggs wrote:
> 
> >> Sent: Wednesday, May 02, 2018 at 8:09 PM
> >> From: "Laine Stump" 
> 
> >>
> >> Also, if virtio works, then *definitely* use that instead of e1000 - the
> >> performance will be much better and overhead much lower.
> >>
> >>
> > so any network test will do?
> > 
> 
> 
> Do you mean to test and see if virtio-net is acceptable for your guest
> OS? If the guest OS has the driver for virtio-net, then definitely you
> should use it. I've never heard of a case of any of the drivers that
> emulate real hardware performing anywhere near as well as virtio-net.
> 

no, I mean test the virtual nic speed, will ipref work?
also, in the guest os, the module attached to the virtual nic is virtio-pci, is 
that expected?

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] connecting host and guest vm using a dummy nic

2018-05-02 Thread Laine Stump
On 05/02/2018 01:28 PM, daggs wrote:

>> Sent: Wednesday, May 02, 2018 at 8:09 PM
>> From: "Laine Stump" 

>>
>> Also, if virtio works, then *definitely* use that instead of e1000 - the
>> performance will be much better and overhead much lower.
>>
>>
> so any network test will do?
> 


Do you mean to test and see if virtio-net is acceptable for your guest
OS? If the guest OS has the driver for virtio-net, then definitely you
should use it. I've never heard of a case of any of the drivers that
emulate real hardware performing anywhere near as well as virtio-net.

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] connecting host and guest vm using a dummy nic

2018-05-02 Thread daggs
Greetings Laine,

> Sent: Wednesday, May 02, 2018 at 8:09 PM
> From: "Laine Stump" 
> To: libvirt-users@redhat.com
> Cc: daggs 
> Subject: Re: [libvirt-users] connecting host and guest vm using a dummy nic
>
> On 05/02/2018 12:05 PM, daggs wrote:
> > Greetings Laine,
> > 
> >> Sent: Wednesday, May 02, 2018 at 5:56 PM
> >> From: "Laine Stump" 
> >> To: libvirt-users@redhat.com
> >> Cc: daggs 
> >> Subject: Re: [libvirt-users] connecting host and guest vm using a dummy nic
> >>
> >> On 05/01/2018 12:12 PM, daggs wrote:
> >>>
> >>> I want to see if I understood you correctly, I add:
> >>> 
> >>>
> >>> 
> >>> to the vm's xml, this will result in a new nic in the vm which and in the 
> >>> host which I can use by the host to request dhcp from the router within 
> >>> the vm?
> >>>
> >>
> >>
> >> Yes. As long as the emulated device in the guest is listening for DHCP
> >> on that interface.
> >>
> >> Also, note that (as long as your libvirt is at least version 2.1.0) if
> >> you don't want to bother doing dhcp on the host and guest, you can
> >> assign just a static IP address for the host side of that interface in
> >> the libvirt XML like this:
> >>
> >>
> >>   
> >> 
> >>
> >> 
> >> ...
> >>
> >> You can even specify routes to be added automatically to the host when
> >> that guest is started, e.g.:
> >>
> >>
> >>   
> >> 
> >>
> >> >>   gateway='192.168.254.1' metric='1'/>
> >> 
> >> ...
> >>
> >> (this assumes that on the guest side, the OS has configured the emulated
> >> ethernet device to have address 192.168.254.1). This can be useful if
> >> you want the host to use one path for traffic when the guest isn't
> >> running, but switch when the guest *is* running. (In this case, if you
> >> can set the default route on the host to have a metric of 2 or higher,
> >> then the default route that goes through the guest would be preferred
> >> when present).
> >>
> >> (NB: if you read the documentation for configuring interfaces at
> >> https://libvirt.org/formatdomain.html#ipconfig you'll see references on
> >> how to configure the IP address of the *guest* in libvirt's xml. Note
> >> that this *does not work* for qemu, but only for lxc (and possibly xen,
> >> I don't recall right now). This is a limitation of the way that qemu/kvm
> >> works (the fact that all guest-side IP info is configured in the guest
> >> OS, and libvirt has no reasonable to get to it).)
> >>
> >>
> > 
> > thanks alot!
> > like you've said, I've defined the interface in the xml, booted the device 
> > and updated /etc/network/interfaces to alloc dhcp to vnet0.
> > that resulted in the proper ip and I can see the router inside the vm.
> 
> BTW, if you'll be running other guests on your host, and may start them
> in different orders, you should probably add "
> (or whatever name you like, 15 chars or less and *not* starting with
> "vnet") to the  config. IF you do that, you can be assured
> that the name of the device on the host will always be consistently
> named "vmrouter" (otherwise it just gets the lowest numbered available
> "vnetX" device name each time it's started).
> 
I intend to run only one vm on this system, thanks for the tip.

> 
> > 
> > one thing bothers me, ethtool vnet0 says the speed is 10Mb/s, asking google 
> > suggested several solutions.
> > I've tried changing the model to virtio but the speed stays the same, the 
> > vm router is running kernel 4.4.92, could that be the issue?
> 
> The reported speed should be inconsequential, since there is no wire and
> no physical switch involved. It will transfer data as fast as the code
> can be executed.
> 
> Also, if virtio works, then *definitely* use that instead of e1000 - the
> performance will be much better and overhead much lower.
> 
> 
so any network test will do?

Thanks, 

Dagg.

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] connecting host and guest vm using a dummy nic

2018-05-02 Thread Laine Stump
On 05/02/2018 12:05 PM, daggs wrote:
> Greetings Laine,
> 
>> Sent: Wednesday, May 02, 2018 at 5:56 PM
>> From: "Laine Stump" 
>> To: libvirt-users@redhat.com
>> Cc: daggs 
>> Subject: Re: [libvirt-users] connecting host and guest vm using a dummy nic
>>
>> On 05/01/2018 12:12 PM, daggs wrote:
>>>
>>> I want to see if I understood you correctly, I add:
>>> 
>>>
>>> 
>>> to the vm's xml, this will result in a new nic in the vm which and in the 
>>> host which I can use by the host to request dhcp from the router within the 
>>> vm?
>>>
>>
>>
>> Yes. As long as the emulated device in the guest is listening for DHCP
>> on that interface.
>>
>> Also, note that (as long as your libvirt is at least version 2.1.0) if
>> you don't want to bother doing dhcp on the host and guest, you can
>> assign just a static IP address for the host side of that interface in
>> the libvirt XML like this:
>>
>>
>>   
>> 
>>
>> 
>> ...
>>
>> You can even specify routes to be added automatically to the host when
>> that guest is started, e.g.:
>>
>>
>>   
>> 
>>
>>>   gateway='192.168.254.1' metric='1'/>
>> 
>> ...
>>
>> (this assumes that on the guest side, the OS has configured the emulated
>> ethernet device to have address 192.168.254.1). This can be useful if
>> you want the host to use one path for traffic when the guest isn't
>> running, but switch when the guest *is* running. (In this case, if you
>> can set the default route on the host to have a metric of 2 or higher,
>> then the default route that goes through the guest would be preferred
>> when present).
>>
>> (NB: if you read the documentation for configuring interfaces at
>> https://libvirt.org/formatdomain.html#ipconfig you'll see references on
>> how to configure the IP address of the *guest* in libvirt's xml. Note
>> that this *does not work* for qemu, but only for lxc (and possibly xen,
>> I don't recall right now). This is a limitation of the way that qemu/kvm
>> works (the fact that all guest-side IP info is configured in the guest
>> OS, and libvirt has no reasonable to get to it).)
>>
>>
> 
> thanks alot!
> like you've said, I've defined the interface in the xml, booted the device 
> and updated /etc/network/interfaces to alloc dhcp to vnet0.
> that resulted in the proper ip and I can see the router inside the vm.

BTW, if you'll be running other guests on your host, and may start them
in different orders, you should probably add "
(or whatever name you like, 15 chars or less and *not* starting with
"vnet") to the  config. IF you do that, you can be assured
that the name of the device on the host will always be consistently
named "vmrouter" (otherwise it just gets the lowest numbered available
"vnetX" device name each time it's started).


> 
> one thing bothers me, ethtool vnet0 says the speed is 10Mb/s, asking google 
> suggested several solutions.
> I've tried changing the model to virtio but the speed stays the same, the vm 
> router is running kernel 4.4.92, could that be the issue?

The reported speed should be inconsequential, since there is no wire and
no physical switch involved. It will transfer data as fast as the code
can be executed.

Also, if virtio works, then *definitely* use that instead of e1000 - the
performance will be much better and overhead much lower.

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] connecting host and guest vm using a dummy nic

2018-05-02 Thread daggs
Greetings Laine,

> Sent: Wednesday, May 02, 2018 at 5:56 PM
> From: "Laine Stump" 
> To: libvirt-users@redhat.com
> Cc: daggs 
> Subject: Re: [libvirt-users] connecting host and guest vm using a dummy nic
>
> On 05/01/2018 12:12 PM, daggs wrote:
> > 
> > I want to see if I understood you correctly, I add:
> > 
> >
> > 
> > to the vm's xml, this will result in a new nic in the vm which and in the 
> > host which I can use by the host to request dhcp from the router within the 
> > vm?
> > 
> 
> 
> Yes. As long as the emulated device in the guest is listening for DHCP
> on that interface.
> 
> Also, note that (as long as your libvirt is at least version 2.1.0) if
> you don't want to bother doing dhcp on the host and guest, you can
> assign just a static IP address for the host side of that interface in
> the libvirt XML like this:
> 
> 
>   
> 
>
> 
> ...
> 
> You can even specify routes to be added automatically to the host when
> that guest is started, e.g.:
> 
> 
>   
> 
>
>   gateway='192.168.254.1' metric='1'/>
> 
> ...
> 
> (this assumes that on the guest side, the OS has configured the emulated
> ethernet device to have address 192.168.254.1). This can be useful if
> you want the host to use one path for traffic when the guest isn't
> running, but switch when the guest *is* running. (In this case, if you
> can set the default route on the host to have a metric of 2 or higher,
> then the default route that goes through the guest would be preferred
> when present).
> 
> (NB: if you read the documentation for configuring interfaces at
> https://libvirt.org/formatdomain.html#ipconfig you'll see references on
> how to configure the IP address of the *guest* in libvirt's xml. Note
> that this *does not work* for qemu, but only for lxc (and possibly xen,
> I don't recall right now). This is a limitation of the way that qemu/kvm
> works (the fact that all guest-side IP info is configured in the guest
> OS, and libvirt has no reasonable to get to it).)
> 
> 

thanks alot!
like you've said, I've defined the interface in the xml, booted the device and 
updated /etc/network/interfaces to alloc dhcp to vnet0.
that resulted in the proper ip and I can see the router inside the vm.

one thing bothers me, ethtool vnet0 says the speed is 10Mb/s, asking google 
suggested several solutions.
I've tried changing the model to virtio but the speed stays the same, the vm 
router is running kernel 4.4.92, could that be the issue?

Thanks,

Dagg.

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] connecting host and guest vm using a dummy nic

2018-05-02 Thread Laine Stump
On 05/01/2018 12:12 PM, daggs wrote:
> 
> I want to see if I understood you correctly, I add:
> 
>
> 
> to the vm's xml, this will result in a new nic in the vm which and in the 
> host which I can use by the host to request dhcp from the router within the 
> vm?
> 


Yes. As long as the emulated device in the guest is listening for DHCP
on that interface.

Also, note that (as long as your libvirt is at least version 2.1.0) if
you don't want to bother doing dhcp on the host and guest, you can
assign just a static IP address for the host side of that interface in
the libvirt XML like this:


  

   

...

You can even specify routes to be added automatically to the host when
that guest is started, e.g.:


  

   
   

...

(this assumes that on the guest side, the OS has configured the emulated
ethernet device to have address 192.168.254.1). This can be useful if
you want the host to use one path for traffic when the guest isn't
running, but switch when the guest *is* running. (In this case, if you
can set the default route on the host to have a metric of 2 or higher,
then the default route that goes through the guest would be preferred
when present).

(NB: if you read the documentation for configuring interfaces at
https://libvirt.org/formatdomain.html#ipconfig you'll see references on
how to configure the IP address of the *guest* in libvirt's xml. Note
that this *does not work* for qemu, but only for lxc (and possibly xen,
I don't recall right now). This is a limitation of the way that qemu/kvm
works (the fact that all guest-side IP info is configured in the guest
OS, and libvirt has no reasonable to get to it).)

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] connecting host and guest vm using a dummy nic

2018-05-01 Thread daggs
Greetings Laine,

> Sent: Tuesday, May 01, 2018 at 5:30 PM
> From: "Laine Stump" 
> To: libvirt-users@redhat.com
> Cc: daggs 
> Subject: Re: [libvirt-users] connecting host and guest vm using a dummy nic
>
> On 04/30/2018 03:16 PM, daggs wrote:
> > Greetings Laine,
> > 
> >> Sent: Monday, April 30, 2018 at 8:31 PM
> >> From: "Laine Stump" 
> >> To: libvirt-users@redhat.com
> >> Cc: daggs 
> >> Subject: Re: [libvirt-users] connecting host and guest vm using a dummy nic
> >>
> >> On 04/27/2018 06:39 PM, daggs wrote:
> >>> Greetings all,
> >>>
> >>> I have a host machine that runs a router within a vm.
> >>> I want to allow a connection between the host and the guest so the host 
> >>> can connect to the lan provided by the router vm.
> >>> I've created a dummy interface with these commands:
> >>> $ ip link add ens99-dummy type dummy
> >>> $ ip link set ens99-dummy address 52:54:00:1f:d0:ff
> >>>
> >>> this resulted with this output:
> >>> $ ifconfig ens99-dummy
> >>> ens99-dummy Link encap:Ethernet  HWaddr 52:54:00:1F:D0:FF 
> >>>   inet6 addr: fe80::84b5:24ff:fe62:c16d/64 Scope:Link
> >>>   UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
> >>>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> >>>   TX packets:899 errors:0 dropped:0 overruns:0 carrier:0
> >>>   collisions:0 txqueuelen:1000
> >>>   RX bytes:0 (0.0 B)  TX bytes:321727 (314.1 KiB)
> >>>
> >>>
> >>> in my libvirt's xml file I have this entry:
> >>> 
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>>>> function='0x0'/>
> >>> 
> >>
> >> MY first question would be "Why are you using macvtap?" This
> >> unnecessarily complicates the plumbing, leading to more potential places
> >> where it could fail.
> > misconfiguration, question is, what should be the exact config for this.
> > 
> >>
> >> The 2nd question is - Have you looked at the dhcp server running on the
> >> guest to verify that it is indeed listening for DHCP requests on the
> >> guest-side interface associated with the macvtap interface, and that it
> >> is receiving those requests and sending a reply?
> > will test it. as said before, I'm not sure what should be the proper config 
> > in libvirt.
> > 
> >>
> >>>
> >>> after the vm is up, I see the adapter in the vm and the host has one more 
> >>> entry:
> >>> $ ifconfig macvtap0
> >>> macvtap0  Link encap:Ethernet  HWaddr 52:54:00:0C:CB:3E 
> >>>   inet6 addr: fe80::5054:ff:fe0c:cb3e/64 Scope:Link
> >>>   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
> >>>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> >>>   TX packets:889 errors:0 dropped:0 overruns:0 carrier:0
> >>>   collisions:0 txqueuelen:500
> >>>   RX bytes:0 (0.0 B)  TX bytes:320523 (313.0 KiB)
> >>>
> >>> but when I try to request ip via dhcp from both macvtap0 and ens99-dummy 
> >>> I don't get any.
> >>> any idea why?
> >>
> >> Definitely you wouldn't be able to use the macvtap0 device, so if
> >> anything you would want to be using ens99-dummy, but I'm not even
> >> certain *that* would work, as I've never tried it.
> > so use ens99-dummy directly? 
> 
> My suggestion is to scrap the idea of using macvtap and a dummy link
> entirely, and just use a plain tap device. I can't think of any reason
> why you would want to use macvtap rather than tap in this case
> 
> > 
> >>
> >> You've provided no visibility into the configuration of the guest OS in
> >> your virtual machine, but in general if you want a simple connection
> >> between the host and guest that has *no other connections*, you can do
> >> this with a bare tap device:
> 
> like this:
> 
> >>
> >> 
> >>   
> >> 
> >>
> >> This will show up as a single device on the host and a single device in
> >> the guest, not connected to a bridge or a macvtap device or anything,
> >> and will not need any other "ip link blah blah" type setup on the

Re: [libvirt-users] connecting host and guest vm using a dummy nic

2018-05-01 Thread Laine Stump
On 04/30/2018 03:16 PM, daggs wrote:
> Greetings Laine,
> 
>> Sent: Monday, April 30, 2018 at 8:31 PM
>> From: "Laine Stump" 
>> To: libvirt-users@redhat.com
>> Cc: daggs 
>> Subject: Re: [libvirt-users] connecting host and guest vm using a dummy nic
>>
>> On 04/27/2018 06:39 PM, daggs wrote:
>>> Greetings all,
>>>
>>> I have a host machine that runs a router within a vm.
>>> I want to allow a connection between the host and the guest so the host can 
>>> connect to the lan provided by the router vm.
>>> I've created a dummy interface with these commands:
>>> $ ip link add ens99-dummy type dummy
>>> $ ip link set ens99-dummy address 52:54:00:1f:d0:ff
>>>
>>> this resulted with this output:
>>> $ ifconfig ens99-dummy
>>> ens99-dummy Link encap:Ethernet  HWaddr 52:54:00:1F:D0:FF 
>>>   inet6 addr: fe80::84b5:24ff:fe62:c16d/64 Scope:Link
>>>   UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
>>>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>   TX packets:899 errors:0 dropped:0 overruns:0 carrier:0
>>>   collisions:0 txqueuelen:1000
>>>   RX bytes:0 (0.0 B)  TX bytes:321727 (314.1 KiB)
>>>
>>>
>>> in my libvirt's xml file I have this entry:
>>> 
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   >> function='0x0'/>
>>> 
>>
>> MY first question would be "Why are you using macvtap?" This
>> unnecessarily complicates the plumbing, leading to more potential places
>> where it could fail.
> misconfiguration, question is, what should be the exact config for this.
> 
>>
>> The 2nd question is - Have you looked at the dhcp server running on the
>> guest to verify that it is indeed listening for DHCP requests on the
>> guest-side interface associated with the macvtap interface, and that it
>> is receiving those requests and sending a reply?
> will test it. as said before, I'm not sure what should be the proper config 
> in libvirt.
> 
>>
>>>
>>> after the vm is up, I see the adapter in the vm and the host has one more 
>>> entry:
>>> $ ifconfig macvtap0
>>> macvtap0  Link encap:Ethernet  HWaddr 52:54:00:0C:CB:3E 
>>>   inet6 addr: fe80::5054:ff:fe0c:cb3e/64 Scope:Link
>>>   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>   TX packets:889 errors:0 dropped:0 overruns:0 carrier:0
>>>   collisions:0 txqueuelen:500
>>>   RX bytes:0 (0.0 B)  TX bytes:320523 (313.0 KiB)
>>>
>>> but when I try to request ip via dhcp from both macvtap0 and ens99-dummy I 
>>> don't get any.
>>> any idea why?
>>
>> Definitely you wouldn't be able to use the macvtap0 device, so if
>> anything you would want to be using ens99-dummy, but I'm not even
>> certain *that* would work, as I've never tried it.
> so use ens99-dummy directly? 

My suggestion is to scrap the idea of using macvtap and a dummy link
entirely, and just use a plain tap device. I can't think of any reason
why you would want to use macvtap rather than tap in this case

> 
>>
>> You've provided no visibility into the configuration of the guest OS in
>> your virtual machine, but in general if you want a simple connection
>> between the host and guest that has *no other connections*, you can do
>> this with a bare tap device:

like this:

>>
>> 
>>   
>> 
>>
>> This will show up as a single device on the host and a single device in
>> the guest, not connected to a bridge or a macvtap device or anything,
>> and will not need any other "ip link blah blah" type setup on the host.
>> Simplifying your setup in this manner may make it easier to find the
>> source of your problem.
>>
> 
> ok, here is the entire xml file:

(I actually meant the network configuration within the guest OS, not the
libvirt config of the virtual machine it's running on)


> 
> 
>   router
>   ed8eabe2-ced3-4224-aa12-60fb31dd3fd4
>   1048576
>   1048576
>   2
>   
> hvm
> 
>   
>   
> 
> 
>   
>   
>   
> 
> 
> 
>   
>   destroy
>   restart
>   restart
>   
> 
> 
>   
>   
> /usr/bin/kvm
> 

Re: [libvirt-users] connecting host and guest vm using a dummy nic

2018-04-30 Thread daggs
Greetings Laine,

> Sent: Monday, April 30, 2018 at 8:31 PM
> From: "Laine Stump" 
> To: libvirt-users@redhat.com
> Cc: daggs 
> Subject: Re: [libvirt-users] connecting host and guest vm using a dummy nic
>
> On 04/27/2018 06:39 PM, daggs wrote:
> > Greetings all,
> > 
> > I have a host machine that runs a router within a vm.
> > I want to allow a connection between the host and the guest so the host can 
> > connect to the lan provided by the router vm.
> > I've created a dummy interface with these commands:
> > $ ip link add ens99-dummy type dummy
> > $ ip link set ens99-dummy address 52:54:00:1f:d0:ff
> > 
> > this resulted with this output:
> > $ ifconfig ens99-dummy
> > ens99-dummy Link encap:Ethernet  HWaddr 52:54:00:1F:D0:FF 
> >   inet6 addr: fe80::84b5:24ff:fe62:c16d/64 Scope:Link
> >   UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
> >   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> >   TX packets:899 errors:0 dropped:0 overruns:0 carrier:0
> >   collisions:0 txqueuelen:1000
> >   RX bytes:0 (0.0 B)  TX bytes:321727 (314.1 KiB)
> > 
> > 
> > in my libvirt's xml file I have this entry:
> > 
> >   
> >   
> >   
> >   
> >   
> >> function='0x0'/>
> > 
> 
> MY first question would be "Why are you using macvtap?" This
> unnecessarily complicates the plumbing, leading to more potential places
> where it could fail.
misconfiguration, question is, what should be the exact config for this.

> 
> The 2nd question is - Have you looked at the dhcp server running on the
> guest to verify that it is indeed listening for DHCP requests on the
> guest-side interface associated with the macvtap interface, and that it
> is receiving those requests and sending a reply?
will test it. as said before, I'm not sure what should be the proper config in 
libvirt.

> 
> > 
> > after the vm is up, I see the adapter in the vm and the host has one more 
> > entry:
> > $ ifconfig macvtap0
> > macvtap0  Link encap:Ethernet  HWaddr 52:54:00:0C:CB:3E 
> >   inet6 addr: fe80::5054:ff:fe0c:cb3e/64 Scope:Link
> >   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
> >   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> >   TX packets:889 errors:0 dropped:0 overruns:0 carrier:0
> >   collisions:0 txqueuelen:500
> >   RX bytes:0 (0.0 B)  TX bytes:320523 (313.0 KiB)
> > 
> > but when I try to request ip via dhcp from both macvtap0 and ens99-dummy I 
> > don't get any.
> > any idea why?
> 
> Definitely you wouldn't be able to use the macvtap0 device, so if
> anything you would want to be using ens99-dummy, but I'm not even
> certain *that* would work, as I've never tried it.
so use ens99-dummy directly? 

> 
> You've provided no visibility into the configuration of the guest OS in
> your virtual machine, but in general if you want a simple connection
> between the host and guest that has *no other connections*, you can do
> this with a bare tap device:
> 
> 
>   
> 
> 
> This will show up as a single device on the host and a single device in
> the guest, not connected to a bridge or a macvtap device or anything,
> and will not need any other "ip link blah blah" type setup on the host.
> Simplifying your setup in this manner may make it easier to find the
> source of your problem.
> 

ok, here is the entire xml file:


  router
  ed8eabe2-ced3-4224-aa12-60fb31dd3fd4
  1048576
  1048576
  2
  
hvm

  
  


  
  
  



  
  destroy
  restart
  restart
  


  
  
/usr/bin/kvm

  
  
  
  


  


  
  


  
  


  
  


  



  
  


  
  
  


  
  
  


  
  
  


  
  
  


  
  
  


  
  
  


  
  
  


  
  
  
  


  


  




  


  
  


  

  
  


  

  
  


  

  
  


  

  


what I don't get is how to connect the interface above to the dummy one I've 
created.

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] connecting host and guest vm using a dummy nic

2018-04-30 Thread Laine Stump
On 04/27/2018 06:39 PM, daggs wrote:
> Greetings all,
> 
> I have a host machine that runs a router within a vm.
> I want to allow a connection between the host and the guest so the host can 
> connect to the lan provided by the router vm.
> I've created a dummy interface with these commands:
> $ ip link add ens99-dummy type dummy
> $ ip link set ens99-dummy address 52:54:00:1f:d0:ff
> 
> this resulted with this output:
> $ ifconfig ens99-dummy
> ens99-dummy Link encap:Ethernet  HWaddr 52:54:00:1F:D0:FF 
>   inet6 addr: fe80::84b5:24ff:fe62:c16d/64 Scope:Link
>   UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>   TX packets:899 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:1000
>   RX bytes:0 (0.0 B)  TX bytes:321727 (314.1 KiB)
> 
> 
> in my libvirt's xml file I have this entry:
> 
>   
>   
>   
>   
>   
>function='0x0'/>
> 

MY first question would be "Why are you using macvtap?" This
unnecessarily complicates the plumbing, leading to more potential places
where it could fail.

The 2nd question is - Have you looked at the dhcp server running on the
guest to verify that it is indeed listening for DHCP requests on the
guest-side interface associated with the macvtap interface, and that it
is receiving those requests and sending a reply?

> 
> after the vm is up, I see the adapter in the vm and the host has one more 
> entry:
> $ ifconfig macvtap0
> macvtap0  Link encap:Ethernet  HWaddr 52:54:00:0C:CB:3E 
>   inet6 addr: fe80::5054:ff:fe0c:cb3e/64 Scope:Link
>   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>   TX packets:889 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:500
>   RX bytes:0 (0.0 B)  TX bytes:320523 (313.0 KiB)
> 
> but when I try to request ip via dhcp from both macvtap0 and ens99-dummy I 
> don't get any.
> any idea why?

Definitely you wouldn't be able to use the macvtap0 device, so if
anything you would want to be using ens99-dummy, but I'm not even
certain *that* would work, as I've never tried it.

You've provided no visibility into the configuration of the guest OS in
your virtual machine, but in general if you want a simple connection
between the host and guest that has *no other connections*, you can do
this with a bare tap device:


  


This will show up as a single device on the host and a single device in
the guest, not connected to a bridge or a macvtap device or anything,
and will not need any other "ip link blah blah" type setup on the host.
Simplifying your setup in this manner may make it easier to find the
source of your problem.

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users