Jump to content


Not sure how to make computer connect server via internet.

server connect internet port ip

  • Please log in to reply
12 replies to this topic

#1 yhs

yhs

    Member

  • Members
  • PipPip
  • 14 posts

Posted 16 August 2017 - 11:57 AM

I can make other computer to connect server by internet but not sure how to do it properly.
I use MackBookPro as server and OSX 10.10, newest version of p4.
Here is my step:

1.Turn off fire wall and set port forward for my server computer.
2.install p4 and p4v.
3.Try to set port for p4 with my public ip "export P4PORT=111.240.147.89:16666"
4.When I want to try p4 info "p4 info", I got error:

Perforce client error:
Connect to server failed; check $PORT.
TCP connect to 111.240.147.89:1666 failed.
connect: 111.240.147.89.1666: Connection refused

5.run "p4d", got error too:

Perforce server error:
Listen 111.240.147.89:1666 failed.
TPC listen on 111.240.147.89:1666 failed.
bind 111.240.147.89:1666 Can't assign requested address

6.Try use "export P4PORT=localhost:16666", and "p4d", can run server successfully.
7.Found some people saying there's no need to assign ip to port. So I use "export P4PORT=16666"
8.use "p4 info", got error:

Connect to server failed; check $PORT.
TCP connect to perforce:1666 failed.
nodename nor servname provided, or not known

9.use "p4d", can run server, and computer in other place can connect to this server!?

So my question is:
1.Why I failed when assign public IP but success when I just assign 1666 only?
2.Why I can run server and make people connect to it but still got error with "p4 info" command?

Thank you

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1155 posts

Posted 17 August 2017 - 04:48 PM

P4PORT for the server tells it what interface to listen on; if you run p4d with P4PORT=1666 it's available via that port on all network interfaces.

The fact that you got that error when setting p4d's P4PORT to the public IP makes me suspect that's not the right IP.  Try "ipconfig"?

When you set the client's P4PORT, you're telling it where the server is.  If you run a client command like "p4 info" with P4PORT=1666 it looks on localhost (i.e. the same machine), so this won't work for anyone who's not logged into the machine where the server is running.

#3 yhs

yhs

    Member

  • Members
  • PipPip
  • 14 posts

Posted 19 August 2017 - 03:56 AM

Hi, thanks for reply

1.My server computer in connect internet by LAN, not sure if it's affect the result. I'm not really seem something like normal public ip with "ifconfig" command in mac.  So I use like "findmyip.org" website. Other people can ping it, it's ok. And I set port forward on the router to this server computer with it's physical ip. I assume when other computer connect to my public ip with 1666 port, router will distribute this connect to my server computer. Not sure if it's work like this.

2.I thought "p4 info" is like checking the status of server machine right now. Even I use p4v to connect to server, I still got error if I run this command on server computer.

Sorry for being a newbie of internet working.   Thanks

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1155 posts

Posted 21 August 2017 - 02:03 AM

1) Okay, sounds like that part is set up correctly (in theory).
2) "p4 info" gives you info about the server, which requires being able to connect to it.

It's not even clear to me right now whether your server is running, so let's take it one step at a time.  :)  Run:

p4 -p 1666 info

That will give you the info for a server running on your local machine.  If it gives a connection failure error, your Perforce server is not running.

#5 yhs

yhs

    Member

  • Members
  • PipPip
  • 14 posts

Posted 27 August 2017 - 09:21 AM

Yes there's some information if I type "p4 -p 1666 info" , but not  with "p4 info".
And other people can connect to my server and submit file.
So what's difference in between this two commands? Why p4 info not working?
Thanks for your help

#6 Mailman Sync

Mailman Sync

    Advanced Member

  • Maillist Aggregator
  • 2495 posts

Posted 27 August 2017 - 01:25 PM

Originally posted to the perforce-user mailing list by: Michael Mirman


"p4 info" will use the P4PORT set not from the global options (as opposed to "p4 -p 1666 info").
My guess is that whatever default setting "p4 info" goes with - whether from P4CONFIG or environment, or the general default "perforce:1666" is different from "1666".

The difference between 1666 and "perforce:1666" is big.
The way the server runs (p4d -p option), and the protect table can allow one access and disallow the other one.

--
Michael Mirman
MathWorks, Inc.
508-647-7555

-----Original Message-----
From: perforce-user [mailto:perforce-user-bounces@perforce.com] On Behalf Of yanghansyuan
Sent: Sunday, August 27, 2017 5:25 AM
To: perforce-user@perforce.com
Subject: Re: [p4] Not sure how to make computer connect server via internet.

Posted on behalf of forum user 'yanghansyuan'.

Yes there's some information if I type "p4 -p 1666 info" , but
not  with "p4 info".
And other people can connect to my server and submit file.
So what's difference in between this two commands? Why p4 info not working?
Thanks for your help



--
Please click here to see the post in its original format:
  http://forums.perfor...er-via-internet
_______________________________________________
perforce-user mailing list  -  perforce-user@perforce.com
http://maillist.perf...o/perforce-user
_______________________________________________
perforce-user mailing list  -  perforce-user@perforce.com
http://maillist.perf...o/perforce-user


#7 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1155 posts

Posted 27 August 2017 - 09:55 PM

View PostMailman Sync, on 27 August 2017 - 01:25 PM, said:

The difference between 1666 and "perforce:1666" is big.
The way the server runs (p4d -p option), and the protect table can allow one access and disallow the other one.

More importantly, if you haven't set up a DNS entry for the host "perforce" to point to your Perforce server, "perforce:1666" just goes nowhere at all.  In which case you'll get an error like:

C:\Users\Samwise>p4 -p perforce:1666 info
Perforce client error:
		Connect to server failed; check $P4PORT.
		TCP connect to perforce:1666 failed.
		No such host is known.

Anyway -- now that we've established that your server is running, let's see if your public IP gets routed to it.  Run:

p4 -p 111.240.147.89:1666 info


#8 yhs

yhs

    Member

  • Members
  • PipPip
  • 14 posts

Posted 24 October 2017 - 03:11 PM

Hi
Sorry about late reply.
So I type what you said:
p4 -p 111.240.147.89:1666 info

and got this:

Perforce client error:
    Connect to server failed; check $P4PORT.
    TCP connect to 111.240.147.89:1666 failed.
    connect: 111.240.147.89:1666: Operation timed out

But my server still running and people can still connect to it. What's this means about "public IP gets routed to it."?

Thanks

#9 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1155 posts

Posted 24 October 2017 - 05:35 PM

If you can ping that IP but "p4 info" against it doesn't work, it might mean the port forwarding isn't set up right, or that it's blocked by a firewall.  The message is getting to that machine but it's not being forwarded to your Perforce server.

#10 yhs

yhs

    Member

  • Members
  • PipPip
  • 14 posts

Posted 25 October 2017 - 02:31 PM

hummm, but if I didn't setup the port forward..I shoundn't connect server successfully from other computer, right?

#11 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1155 posts

Posted 25 October 2017 - 02:48 PM

Is the other computer connecting using the same P4PORT (the public IP)?

#12 yhs

yhs

    Member

  • Members
  • PipPip
  • 14 posts

Posted 01 November 2017 - 02:59 PM

Yes...Still not sure why it's work....

#13 p4rfong

p4rfong

    Advanced Member

  • Staff Moderators
  • 343 posts

Posted 08 November 2017 - 02:34 AM

Try starting p4d with no hostname.

For example:

p4d -r <P4ROOT> -p 1666 -J journal -L log -d





Also tagged with one or more of these keywords: server, connect, internet, port, ip

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users