Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

Connecting to cfdev from LAN how to map ip/host? #67

Closed
airduster opened this issue Dec 31, 2018 · 3 comments
Closed

Connecting to cfdev from LAN how to map ip/host? #67

airduster opened this issue Dec 31, 2018 · 3 comments

Comments

@airduster
Copy link

airduster commented Dec 31, 2018

Using Win10 Pro machine would like to connect to pcfdev from another machine on local network with standard config of:

192.168.1.xxx ip address ranges 1-254
192.168.1.1 gateway.

By default pcfdev uses 10.144.0.34 on local machine hosting it (192.168.1.100) and maps to
https://apps.dev.cfdev.sh host.

on the lan we can ping 10.144.0.34 but cannot connect to https://apps.dev.cfdev.sh other than from the localhost hosting pcfdev.

Is there a way to expose https://apps.dev.cfdev.sh uri so that all local area machines can access it?
Specifically, we just want to deploy directly from multiple eclipse IDE's to a single shared pcfdev

Found this on stackoverflow: https://stackoverflow.com/questions/41639600/access-pcf-dev-from-external-machine-on-same-network-as-host

but it appears to be referring to the previous and now deprecated version of pcfdev. Tried their solution and did not work with current version

@airduster airduster changed the title Connecting to Pcfdev from LAN how to map ip/host? Connecting to cfdev from LAN how to map ip/host? Dec 31, 2018
@airduster
Copy link
Author

airduster commented Dec 31, 2018

Made some progress on this. Current Hack solution is ( Is there a better one?)

On machine hosting cfdev/pcfdev (Server) (mine 192.168.1.100)

1. Open command prompt in administrative mode. mode and enter the following:

2. now type netsh (press enter) then type the following (substitute your own local machine ip, 127.0.0.1 might work as well)

interface portproxy add v4tov4 listenport=80 listenaddress=192.168.1.100 connectport=80 connectaddress=apps.dev.cfdev.sh

interface portproxy add v4tov4 listenport=443 listenaddress=192.168.1.100 connectport=443 connectaddress=apps.dev.cfdev.sh

3. Verify this is done by typing
interface portproxy show all
(if you see the entries you just added then it is already set and live.

**On the client machine you wish to connect to cfdev/pcf dev **

1. Find your hosts file and open it with a text editor in administrative mode.
(C:\Windows\System32\drivers\etc) ["hosts" file]

2. and add the following entries where left column is the LAN IP address of pcfdev/cfdev machine you wish to connect to

	192.168.1.100	apps.dev.cfdev.sh
	192.168.1.100	login.dev.cfdev.sh
        192.168.1.100   api.dev.cfdev.sh

Note: Some things to note here. The IP on our cfdev/pcfdev server box is static and hard coded in our local dns server (192.168.1.100) so above assumes this will never change. Also, assumes any additional subhosts xxx.dev.cfdev.sh would also need to be hard coded into each client's etc/hosts file (wild cards not allowed) as described in the client config above. You can probably install Acrylic DNS Proxy Server to allow for wild cards in one entry like 192.168.1.100 *.dev.cfdev.sh but i've had bad experience with this in the past creating unrelated DNS issues

@aemengo
Copy link
Contributor

aemengo commented Jan 2, 2019

Connecting to pcfdev from another machine is not functionality that we support. Primarily, this is because of security concerns. We'd much rather that you look into small-footprint cf (https://docs.pivotal.io/pivotalcf/2-4/customizing/small-footprint.html) for this use-case.

@aemengo aemengo closed this as completed Jan 2, 2019
@sdawson-pivotal
Copy link

@airduster would you mind sharing a bit about your use case? We are looking to better understand how people are using CF / PCF Dev, and what they are looking for. Your answers to this 4 question survey would be very helpful to us: https://goo.gl/forms/3OHzU2S5907hiu5r1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants