Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
connecting host and guest vm using a dummy nic [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5273

PostPosted: Fri Apr 27, 2018 1:36 pm    Post subject: connecting host and guest vm using a dummy nic [solved] Reply with quote

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.
I've created a dummy interface with these commands:
Code:

ip link add ens99-dummy type dummy
ip link set ens99-dummy address 52:54:00:1f:d0:ff


this resulted with this output:
Code:

$ 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:
Code:

<interface type='direct'>
      <mac address='52:54:00:0c:cb:3e'/>
      <source dev='ens99-dummy' mode='private'/>
      <target dev='macvtap0'/>
      <model type='e1000'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </interface>


after the vm is up, I see the adapter in the vm and the host has one more entry:
Code:

$ 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?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein


Last edited by DaggyStyle on Wed May 02, 2018 4:31 pm; edited 1 time in total
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5273

PostPosted: Wed May 02, 2018 4:30 pm    Post subject: Reply with quote

solved by adding this to the xml file:
Code:
<interface type='network'>
   <model type="virtio"/>
</interface>

and upon the vm boot, vnet# will appear, dhcp request and thats it.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum