How do I configure qemu-kvm to use tap0?

asked 2017-12-28 01:51:47 -0500

toddandmargo gravatar image

updated 2017-12-28 01:52:35 -0500

Hi All,

How do I get my qaemu-kvm virtual machines to use tap0, instead of br0?

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.255.10  netmask 255.255.255.0  broadcast 192.168.255.255
        inet6 fe80::5437:93ff:feaa:c159  prefixlen 64  scopeid 0x20<link>
        ether fe:54:00:30:6e:23  txqueuelen 1000  (Ethernet)
        RX packets 1460457  bytes 88821584 (84.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2327924  bytes 3101051809 (2.8 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.210.50  netmask 255.255.255.0  broadcast 192.168.210.255
        inet6 fe80::7c9b:33ff:fedd:feea  prefixlen 64  scopeid 0x20<link>
        ether 7e:9b:33:dd:fe:ea  txqueuelen 100  (Ethernet)
        RX packets 2171  bytes 211552 (206.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 124  bytes 63283 (61.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

With br0, I can arp-scan 192.168.210.50, but nothing past it. From the ost machine, I can

# arp-scan --interface=tap0 192.168.210.0/24

And I get back two more IP at the other end.

Many thanks, -T

edit retag flag offensive close merge delete

Comments

Tap is old school and uses your bridge normally. See http://hostrepo.com/article.php?id=193 what are you trying to accomplish?

Panther gravatar imagePanther ( 2017-12-30 11:28:03 -0500 )edit

Sorry for the late response. I did not get an eMail notification. I am trying to reach the machines on the other side of my OpenVPN connection from my eqmu-kvm virtual machines. I can from my host machine.

toddandmargo gravatar imagetoddandmargo ( 2018-01-05 20:43:54 -0500 )edit

I am noticing the "route -n" does not show tap0 as a gateway

route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.250.1   0.0.0.0         UG    100    0        0 enp7s0
169.254.0.0     0.0.0.0         255.255.0.0     U     1004   0        0 br0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
192.168.200.0   0.0.0.0         255.255.255.0   U     0      0        0 tap0
192.168.250.0   0.0.0.0         255.255.255.0   U     100    0        0 enp7s0
toddandmargo gravatar imagetoddandmargo ( 2018-01-05 20:55:43 -0500 )edit

But I did not do a "ip route add 192.168.200.50 dev tap0". I would like to be able to set it globally to tap0 so I do not have to do it for each virtual machine one at a time and every time tap0's IP changes

toddandmargo gravatar imagetoddandmargo ( 2018-01-05 20:58:21 -0500 )edit