I've created a VM guest with libvirt with the default NAT Bridge. (Host and Guest Ubuntu 14.04 Server) After creating allow rules for SSH and enabling ufw - on the guest - i can't connect to the guest anymore.
From syslog (of the guest):
Oct 6 17:36:51 ubuntu kernel: [ 5969.693057] [UFW BLOCK] IN=eth0 OUT=MAC=52:54:00:ea:b5:2e:fe:54:00:ea:b5:2e:08:00 SRC=192.168.122.1 DST=192.168.122.152 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=5379 DF PROTO=TCP SPT=34376 DPT=22 WINDOW=29200 RES=0x00 SYN URGP=0
Status of ufw(on the guest):
root@ubuntu:~# ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To Action From
-- ------ ----
Anywhere ALLOW IN 148.251.139.136 22/tcp
Anywhere ALLOW IN 148.251.139.133 22/tcp
Anywhere ALLOW IN 141.7.0.0/16 22/tcp
Anywhere ALLOW IN 192.168.122.0/24 22/tcp
Anywhere ALLOW IN 192.168.122.1 22/tcp
148.251.139.136 is the IP of the Host, Guest is 192.168.122.152. I have no idea why ufw blocks the allowed IP of the Host/NAT.
If i disable ufw on the guest i can connect from the host via SSH without problems.
edit: for clarification, these are logs of the guest. NAT routing is working. The problem seems to be on the VM guest side.
disabled (routed)
?routed
. That is it can talk to all nets that it is directly connected to. And if it want to connect to computers that are on other LAN:s, it just need to connect to a router that is on a network that the guest is connected too. No need to allowrouted
for that. Just allow outgoing for the protocol and IP-addresses.