You are not logged in.

#1 2020-12-31 20:14:21

Registered: 2013-08-24
Posts: 80

iptables rules to allow KVM Windows guest to mount NFS share on host?

I am using a Windows 7 VM on KVM with virt-manager
I was never able to get any kind of file sharing to work with Samba, so I decided to use NFS instead.

I setup my NFS server etc - but the guest cannot mount the shared drive unless the firewall is disabled
I have the following rules in iptables.rules

:OUTPUT ACCEPT [89:4852]
:TCP - [0:0]
:UDP - [0:0]
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate INVALID -j DROP
-A INPUT -p icmp -m icmp --icmp-type 8 -m conntrack --ctstate NEW -j ACCEPT
-A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable
-A INPUT -p tcp -j REJECT --reject-with tcp-reset
-A INPUT -j REJECT --reject-with icmp-proto-unreachable
-A INPUT -p udp -m conntrack --ctstate NEW -j UDP
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m conntrack --ctstate NEW -j TCP
-A INPUT -s -p tcp -m tcp --dport 3000 -j ACCEPT
-A INPUT -s -p tcp -m tcp --dport 3000 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 3000 -j DROP
-A TCP -p tcp -m tcp --dport 3000 -j ACCEPT

# NFS rules
-A INPUT -s  -d  -p udp -m multiport --dports 10053,111,2049,32769,875,892 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A INPUT -s  -d  -p tcp -m multiport --dports 10053,111,2049,32803,875,892 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A OUTPUT -s  -d  -p udp -m multiport --sports 10053,111,2049,32769,875,892 -m state --state ESTABLISHED -j ACCEPT 
-A OUTPUT -s  -d  -p tcp -m multiport --sports 10053,111,2049,32803,875,892 -m state --state ESTABLISHED -j ACCEPT 
-I INPUT  -i lo -d -j ACCEPT
-I OUTPUT  -o lo -s -j ACCEPT

My virbr0 interface is on
From the VM the host is

What should I change in the above rules to get it to work?

Thanks in Advance


Board footer

Powered by FluxBB