Vagrant openldap and port forwarding

246 views
Skip to first unread message

blahblah

unread,
Sep 12, 2015, 7:26:27 PM9/12/15
to Vagrant
Hi I was wondering if anybody has done anything with openldap and port forwarding?  I'm trying to test a openldap repository but am not able to due to port forwarding not responding. 

On my vagrant I have 
guest: 389, host: 1389
guest: 636, host: 1636

The vagrant box I have is centos 7.  I've turned off firewalld and also tested basic ldap responses via ldapsearch.

I'm not too knowledgable about firewalld.  If I shut it down firewalld does my vagrant not respond to the ports at all?

Thanks.

Alvaro Miranda Aguilera

unread,
Sep 12, 2015, 7:52:02 PM9/12/15
to vagra...@googlegroups.com
Can you share the Vagrantfile and the commands you use to stop firewalld?
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/40fd9ed4-aed6-4f9a-9549-8b7145491869%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

blahblah

unread,
Sep 12, 2015, 10:19:39 PM9/12/15
to Vagrant

To stop the firewall I used systemctl stop firewalld


Vagrantfile below


------------------------------

# -*- mode: ruby -*-

# vi: set ft=ruby :


# All Vagrant configuration is done below. The "2" in Vagrant.configure

# configures the configuration version (we support older styles for

# backwards compatibility). Please don't change it unless you know what

# you're doing.

Vagrant.configure(2) do |config|

  # The most common configuration options are documented and commented below.

  # For a complete reference, please see the online documentation at

  # https://docs.vagrantup.com.


  # Every Vagrant development environment requires a box. You can search for

  # boxes at https://atlas.hashicorp.com/search.

  config.vm.box = "centos6.3"


  # Disable automatic box update checking. If you disable this, then

  # boxes will only be checked for updates when the user runs

  # `vagrant box outdated`. This is not recommended.

  # config.vm.box_check_update = false


  # Create a forwarded port mapping which allows access to a specific port

  # within the machine from a port on the host machine. In the example below,

  # accessing "localhost:8080" will access port 80 on the guest machine.

  # config.vm.network "forwarded_port", guest: 80, host: 8080

  config.vm.network "forwarded_port", guest: 636, host: 1636

  config.vm.network "forwarded_port", guest: 389, host: 1389


  # Create a private network, which allows host-only access to the machine

  # using a specific IP.

  # config.vm.network "private_network", ip: "192.168.33.10"


  # Create a public network, which generally matched to bridged network.

  # Bridged networks make the machine appear as another physical device on

  # your network.

  # config.vm.network "public_network"


  # Share an additional folder to the guest VM. The first argument is

  # the path on the host to the actual folder. The second argument is

  # the path on the guest to mount the folder. And the optional third

  # argument is a set of non-required options.

  # config.vm.synced_folder "../data", "/vagrant_data"


  # Provider-specific configuration so you can fine-tune various

  # backing providers for Vagrant. These expose provider-specific options.

  # Example for VirtualBox:

  #

  # config.vm.provider "virtualbox" do |vb|

  #   # Display the VirtualBox GUI when booting the machine

  #   vb.gui = true

  #

  #   # Customize the amount of memory on the VM:

  #   vb.memory = "1024"

  # end

  #

  # View the documentation for the provider you are using for more

  # information on available options.


  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies

  # such as FTP and Heroku are also available. See the documentation at

  # https://docs.vagrantup.com/v2/push/atlas.html for more information.

  # config.push.define "atlas" do |push|

  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"

  # end


  # Enable provisioning with a shell script. Additional provisioners such as

  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the

  # documentation for more information about their specific syntax and use.

  # config.vm.provision "shell", inline: <<-SHELL

  #   sudo apt-get update

  #   sudo apt-get install -y apache2

  # SHELL

end

------------

blahblah

unread,
Sep 12, 2015, 10:33:13 PM9/12/15
to Vagrant
Actually I think I solved it but unconventionally ....
I was using the latest centos (centos 7) while all the tut's for doing open ldap and iptable inbound connections were using the old iptable file on centos 6 versions that still used the old iptables edit method.

With centos 7 I believe they switched over to firewalld and you have to indirectly edit the inbound connections via commands.  I didn't actually know how to work it so I just turned it off the firewalld service which is probably my mistake.  

Currently using an older centos 6.3 vagrant (can't mount vagrant directory) but I was able to add the 636 and 389 accept inbound connection into the iptables file.

Not that I'm trying to avoid learning how to use the new iptables but the objective was getting a proof of concept openldap going so I can hit it property.  it's been a trying week just trying to get that working so I didn't want to spend more time learning yet another tool :D  

TLDR; Got lazy and didn't want to get too involved.  Ended up getting involved anyways.
Reply all
Reply to author
Forward
0 new messages