{"id":6684,"date":"2017-05-08T12:37:08","date_gmt":"2017-05-08T04:37:08","guid":{"rendered":"http:\/\/rmohan.com\/?p=6684"},"modified":"2017-05-08T12:37:08","modified_gmt":"2017-05-08T04:37:08","slug":"centos-rhel-7-how-to-open-the-firewall-port-for-samba-server-using-firewalld","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6684","title":{"rendered":"CentOS \/ RHEL 7 : How to open the Firewall port for Samba server using FirewallD"},"content":{"rendered":"<p>Question : I cannot reach my Samba server after starting the service. How do I open the port to be able to connect to my Samba server?<\/p>\n<p>Solution :<\/p>\n<p>If running FirewallD, it is mandatory to open the ports used by the Samba server in order for it to properly accept clients. To begin with check the firewalld status using the systemctl command :<\/p>\n<p># systemctl status firewalld<br \/>\n? firewalld.service &#8211; firewalld &#8211; dynamic firewall daemon<br \/>\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/firewalld.service; enabled; vendor preset: enabled)<br \/>\n   Active: active (running) since Sat 2016-10-29 21:47:04 IST; 1 weeks 4 days ago<br \/>\n Main PID: 1055 (firewalld)<br \/>\n   CGroup: \/system.slice\/firewalld.service<br \/>\n           ??1055 \/usr\/bin\/python -Es \/usr\/sbin\/firewalld &#8211;nofork &#8211;nopid<\/p>\n<p>Oct 29 21:46:50 localhost.localdomain systemd[1]: Starting firewalld &#8211; dynamic firewall daemon&#8230;<br \/>\nOct 29 21:47:04 localhost.localdomain systemd[1]: Started firewalld &#8211; dynamic firewall daemon.<br \/>\nAs seen in the output above the firewall service is active and running. So we are good to go further.<\/p>\n<p>Check the list of open ports and services using the commands below :<\/p>\n<p># firewall-cmd &#8211;list-ports<br \/>\n# firewall-cmd &#8211;list-services<br \/>\nOnce you have confirmed that the samba ports are not open on the system, open the Samba port using the following FirewallD command:<\/p>\n<p># firewall-cmd &#8211;add-service=samba<br \/>\nThe above command will change the runtime, opening the port temporarily. Make the changes permanent using the following command (this will persist through reboot):<\/p>\n<p># firewall-cmd &#8211;add-service=samba &#8211;permanent<br \/>\nVerify<\/p>\n<p>To verify if the samba service is added to the firewalld use :<\/p>\n<p># firewall-cmd &#8211;list-services<br \/>\ndhcpv6-client samba ssh<br \/>\nAs you can see samba service is now added to the firewall and samba ports are now open.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question : I cannot reach my Samba server after starting the service. How do I open the port to be able to connect to my Samba server?<\/p>\n<p>Solution :<\/p>\n<p>If running FirewallD, it is mandatory to open the ports used by the Samba server in order for it to properly accept clients. To begin with [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6684"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6684"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6684\/revisions"}],"predecessor-version":[{"id":6685,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6684\/revisions\/6685"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}