Puncte:0

UFW Unblock Host to Guest Traffic

drapel tr

I am on Ubuntu 20.04 and I have enable UFW as a killswitch to work with my wireguard vpn. My current rules work perfectly, except that traffic between my ubuntu host and my debian 10.5 virtualbox guest is blocked.

How can I unblock host / guest traffic?

My current UFW Rules are:

[ 1] 22/tcp                     ALLOW IN    Anywhere                  
[ 2] Anywhere                   ALLOW OUT   Anywhere on wg-client1     (out)
[ 3] 80/tcp                     ALLOW IN    Anywhere                  
[ 4] 443/tcp                    ALLOW IN    Anywhere                  
[ 5] Anywhere on wg-client1     ALLOW IN    Anywhere                  
[ 6] 94.121.83.88               ALLOW OUT   Anywhere                   (out)
[ 7] 21/tcp                     ALLOW IN    Anywhere                  
[ 8] 53                         ALLOW OUT   Anywhere                   (out)
[ 9] 9418/tcp                   ALLOW IN    Anywhere                  

I previously tried the following that all failed (i.e. when I ping guest ip192.168.0.84, I get ping: sendmsg: Operation not permitted)

[10] 22/tcp                     ALLOW IN    10.10.10.2                
[11] 22/tcp                     ALLOW IN    192.168.0.0/24            
[12] Anywhere                   ALLOW IN    192.168.0.0/24            
[13] 192.168.0.0/24             ALLOW IN    Anywhere                  
[14] 192.168.0.0/24 22          ALLOW IN    Anywhere                  
[15] Anywhere                   ALLOW IN    192.168.0.0/24 22 

I also use masquerade to put all traffic through the vpn. My ifconfig -a output is:

enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.18  netmask 255.255.255.0  broadcast 192.168.0.255
        ether b4:a9:fc:b0:b0:d1  txqueuelen 1000  (Ethernet)
        RX packets 668474  bytes 477052588 (477.0 MB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 945227  bytes 553827446 (553.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 2106  bytes 198789 (198.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2106  bytes 198789 (198.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vboxnet0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 0a:00:27:00:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vboxnet1: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 0a:00:27:00:00:01  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wg-client1: flags=209<UP,POINTOPOINT,RUNNING,NOARP>  mtu 1420
        inet 10.10.10.2  netmask 255.255.255.255  destination 10.10.10.2
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
        RX packets 565766  bytes 350115976 (350.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 451704  bytes 440547648 (440.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp0s10f2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.6  netmask 255.255.255.0  broadcast 192.168.0.255
        ether 34:cf:f6:61:c0:38  txqueuelen 1000  (Ethernet)
        RX packets 433847  bytes 102427035 (102.4 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 94319  bytes 29872001 (29.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

It should be noted that my debian guest has two network interfaces, 1 static 192.168.0.84 and one dynamic so that I can use multiple wifi networks.

# The primary network interface
auto enp0s3
iface enp0s3 inet static
        address 192.168.0.84
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
       
#dynamic gateway for Internet access on random networks
auto enp0s8
iface enp0s8 inet dhcp

thx

UPDATE I finally figured out my sys logs and I noticed this:
[UFW BLOCK] IN= OUT=wlp0s10f2 SRC=192.168.0.255 DST=192.168.0.84 ....

So of course, I checked the vbox manager and for my bridged connection adapters, I only have 2 options: wlp0s10f2 or enp3s0 (ethernet)

Even though ifocnfig -a shows wg-client1 as network interface, I don't have wg-client1 as an available interface in virtualbox.

I played with different rules to allow 22/tcp from wlp0s10f2 on wg-client1, but haven't been successful.

Any tips?

drapel in
Este conexiunea de rețea a VirtualBox VM configurată la „Permite tot” în setarea Advancedâ¢Promiscuous Mode?
nightwatch avatar
drapel tr
Tocmai am verificat că cele două adaptoare ale mele au fost/sunt ambele setate la „Permite tot” și au fost testate cu ping.. fără noroc... încă blocate
nightwatch avatar
drapel tr
@matigo Am restrâns problema... vreo idee? mersi
Puncte:0
drapel tr

Puțin jenant, dar la mai puțin de 5 minute după începerea primei am rezolvat problema cu o presupunere educată:

sudo ufw permite accesul pe wlp0s10f2 de la oricare la 192.168.0.84

Acum instalarea mea proaspătă funcționează perfect. Greșeala mea a fost utilizarea ip-ului VPN ca adresă de ieșire. Schimbarea acesteia la adresa IP a mașinii vbox. M-a readus pe drumul cel bun.

Postează un răspuns

Majoritatea oamenilor nu înțeleg că a pune multe întrebări deblochează învățarea și îmbunătățește legătura interpersonală. În studiile lui Alison, de exemplu, deși oamenii își puteau aminti cu exactitate câte întrebări au fost puse în conversațiile lor, ei nu au intuit legătura dintre întrebări și apreciere. În patru studii, în care participanții au fost implicați în conversații ei înșiși sau au citit transcrieri ale conversațiilor altora, oamenii au avut tendința să nu realizeze că întrebarea ar influența – sau ar fi influențat – nivelul de prietenie dintre conversatori.