1

I have a KVM host with some VMs The Host has a SMB Share in it

All the guest VMs need to connect to this SMB FileShare And i need it to be via virtual network (preverably KVM's 'default' virtual network)

Unfortunately it does not work,

==> Guest vm can not connect to port 445

==> Guest VM does connect to host on port 22

So... it seems to be firewall related

I installed on the host GUFW tool

And even if i leave everything opened on GUFW,

guest vm still can not connect to port 445 or other ports, except for port 22

This is the virtual network config via the "virsh net-edit default" command:

<network>
  <name>default</name>
  <uuid>79ee9f24-786a-4318-87d9-3b48bcdf1741</uuid>
  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:66:67:6a'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.51' end='192.168.122.99'/>
      <host mac='52:54:00:dc:23:9f' name='zabbix' ip='192.168.122.131'/>
      <host mac='52:54:00:49:fe:47' name='LAB_SFBSE' 
ip='192.168.122.126'/>
    </dhcp>
  </ip>
</network>

The test i am making is a simple telnet command

I have tried on the guest running the telnet against: The IP of the default gateway of virbr0: telnet 192.168.122.1 445 The IP of the Host NIC: telnet 192.168.15.199 445

I managed to get this working via Bridged networking But when i attach the guest VM to the default NAT Network it can only connect to port 22

i have tested this on multiple hosts and multiple installations the behavior is always the same

Any sugestions on how can i get this working?

  • What Linux is it? Some distros will allow easy configuration of iptables through the firewall-cmd command. Example: firewall-cmd --add-service=samba --permanent; firewall-cmd --reload – Havenard Nov 2 '18 at 19:49
  • It's not necessarily firewall related. Have you verified that the smb service is listening on the address(es) you think it is (using, e.g., netstat -tln)? – larsks Nov 2 '18 at 20:06
  • Output of netstat: # netstat -tln |grep 445 tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN tcp6 0 0 :::445 :::* LISTEN – Darwin Ranzone Nov 2 '18 at 20:49
  • firewall-cmd --add-service=samba This command does it I tried adding samba rules using GUFW but it did not work your command did the trick thanks Havenard – Darwin Ranzone Nov 2 '18 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.