C++ and Winsock - Connecting Via Internet

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

44 Replies - 8532 Views - Last Post: 28 October 2013 - 07:38 PM

#31 no2pencil  Icon User is online

  • Dic Head
  • member icon

Reputation: 5167
  • View blog
  • Posts: 26,849
  • Joined: 10-May 07

Re: C++ and Winsock - Connecting Via Internet

Posted 14 October 2013 - 12:26 AM

There is always the possibility that your ISP does not allow port 23 traffic. Try a non-standard port (like 9999) & have you friend pass the port in the telnet command. telnet ip 9999

If that model of router offers logging, I would also suggest enabling logging for the port, & you can then verify that it's coming in through the modem.

Another troubleshooting tip is to hook the server directly to the modem. This will bypass ALL port forwarding issues as the server should take the external ip address directly from the modem & isp/dhcp.
Was This Post Helpful? 0
  • +
  • -

#32 jimblumberg  Icon User is online

  • member icon


Reputation: 3988
  • View blog
  • Posts: 12,301
  • Joined: 25-December 09

Re: C++ and Winsock - Connecting Via Internet

Posted 14 October 2013 - 08:29 AM

Quote

No I've never heard if downloading Netgear genie. What's that for?

Have you ever read the documentation for your router?

Quote

I'm not sure what DSL or Cable Modem I have (How do I check this?).

You physically look at the Modem, write down the Make, Model, Serial Number , and any other information you see.

Quote

And lastly, no I haven't tried connecting my PC to my modem. I didn't think this would do anything differently.

Yes it does things differently. You remove one potential source of the problem. But make sure you reset your "server" to use DHCP to get it's IP address. And remember when you remove the router your computer is now directly connected to the Internet and is vulnerable to attack if left this way for a long period.


Jim
Was This Post Helpful? 0
  • +
  • -

#33 LunaRebirth  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 125
  • Joined: 21-March 13

Re: C++ and Winsock - Connecting Via Internet

Posted 15 October 2013 - 08:38 PM

Guys I found it's definitely the port forwarding that isn't working..
I found that no matter what port I forward, it announces as closed.

I did this by trying to create a minecraft server as well (A friend of mine told me to try it, Since he owns a minecraft server, and see if it works. Since generally, it's the same setup).
It did NOT allow my server to even work, and stated my port for minecraft was closed.

I jotted down some details. This wasn't meant for any specific website, so it may sound like I'm starting over.

AHEM.

I've saw MANY, Countless topics on how people couldn't port forward on the Netgear WNR2000.
But NOTHING I TRY SEEMS TO WORK.

I'm programming a game for online multiplayer. Everything is set up properly to work online. The client connects to the server (Client connects to my External IP) and the server receives any incoming connection.
I've tried MULTIPLE ports for the server/client to connect to, and NOTHING seems to work.

After port forwarding, I've used websites (Such as http://www.yougetsig...ols/open-ports/ ) and the port returns CLOSED.

First, I'd like to explain HOW I port forwarded (Just to let you know I did it correctly). Next, I'd like to give out details on information you may need to know to get this working. (In case you're wondering, I called my provider, and they stated no ports are currently being blocked) (Also, I have a static IP).

So here goes how I did my port forwarding. (In a list)
1. Log into my router (192.168.1.1).
2. User is Admin, Password is Password.
3. Go to the category "Port Forwarding/Port Triggering.
4. Make sure "Port Forwarding" is the selected option.
5. Add my static (Internal) IP.
6. Service Name FTP (Or anything, I guess).
7. Protocol TCP/UDP.
8. Starting/Ending port the port of my server&client.
9. Server IP Address should be like in step 5.
10. Done!

Those are the steps I took on port forwarding. Pretty simple, Right?
Now here's the tricky part.
No matter what I add as a port, NOTHING works. None of the ports list as open, All closed. Even tested by giving a friend (Outside of my router) my client version, It did not find the server (It should have).

Now, Here are what is on router. Maybe there are some problems here I need fixed...

(I never got this far, I did this in notepad..)
If you need any details on what settings I have on my router, just list a few.

P.S. In replies to replies,
I hadn't yet wrote down my serial number and make/model. If that's still a needed factor, Just say so (Sorry, I'm cozy in bed!)
I connected to my router (Ethernet Cable), earlier. There was no change.
I did not read the documentation. Still, even (Sorry=( I hadn't got to it yet).

I tried the telnet on a different port (Used 8796 - Researched, Wasn't used). This failed.

Hooked my laptop to my router (Ethernet), no change.
Was This Post Helpful? 0
  • +
  • -

#34 jimblumberg  Icon User is online

  • member icon


Reputation: 3988
  • View blog
  • Posts: 12,301
  • Joined: 25-December 09

Re: C++ and Winsock - Connecting Via Internet

Posted 15 October 2013 - 09:32 PM

Have you hooked your laptop (Ethernet) to your Modem?

Is your "server" connected via Ethernet or WIFI to your router?

Is your laptop the "server"?

I recommend until you get the basic setup correct that you use an Ethernet connection, not WIFI. Once you get the Ethernet connection working properly you can start working with WIFI, but the Ethernet connection will be much easier to troubleshoot.



Jim
Was This Post Helpful? 0
  • +
  • -

#35 no2pencil  Icon User is online

  • Dic Head
  • member icon

Reputation: 5167
  • View blog
  • Posts: 26,849
  • Joined: 10-May 07

Re: C++ and Winsock - Connecting Via Internet

Posted 16 October 2013 - 04:40 AM

View PostLunaRebirth, on 15 October 2013 - 11:38 PM, said:

So here goes how I did my port forwarding. (In a list)
1. Log into my router (192.168.1.1).
2. User is Admin, Password is Password.
3. Go to the category "Port Forwarding/Port Triggering.
4. Make sure "Port Forwarding" is the selected option.
5. Add my static (Internal) IP.
6. Service Name FTP (Or anything, I guess).
7. Protocol TCP/UDP.
8. Starting/Ending port the port of my server&client.
9. Server IP Address should be like in step 5.
10. Done!
Service names can be anything, & don't specify which port to forward. After doing a Google search for your router, assuming that the images are correct, you have to setup the service to forward. I have a Netgear v318, & this is how it's done. It also allows for port traffic logging, which I suggested & don't see that you tried. This validates the traffic, & is imo a good troubleshooting step, one that I've used.

Define the service with a port.
Add the service & port to the forwarding list.

Can you provide screen shots of your available services & port forwarding rules?
Was This Post Helpful? 0
  • +
  • -

#36 LunaRebirth  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 125
  • Joined: 21-March 13

Re: C++ and Winsock - Connecting Via Internet

Posted 16 October 2013 - 02:19 PM

View Postjimblumberg, on 15 October 2013 - 09:32 PM, said:

Have you hooked your laptop (Ethernet) to your Modem?

Is your "server" connected via Ethernet or WIFI to your router?

Is your laptop the "server"?

I recommend until you get the basic setup correct that you use an Ethernet connection, not WIFI. Once you get the Ethernet connection working properly you can start working with WIFI, but the Ethernet connection will be much easier to troubleshoot.



Jim

1. Yes, I have. No change.

2. Yes, the server program runs on my laptop.

3. I tried, It didn't do anything.
Was This Post Helpful? 0
  • +
  • -

#37 LunaRebirth  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 125
  • Joined: 21-March 13

Re: C++ and Winsock - Connecting Via Internet

Posted 16 October 2013 - 02:33 PM

View Postno2pencil, on 16 October 2013 - 04:40 AM, said:

View PostLunaRebirth, on 15 October 2013 - 11:38 PM, said:

So here goes how I did my port forwarding. (In a list)
1. Log into my router (192.168.1.1).
2. User is Admin, Password is Password.
3. Go to the category "Port Forwarding/Port Triggering.
4. Make sure "Port Forwarding" is the selected option.
5. Add my static (Internal) IP.
6. Service Name FTP (Or anything, I guess).
7. Protocol TCP/UDP.
8. Starting/Ending port the port of my server&client.
9. Server IP Address should be like in step 5.
10. Done!
Service names can be anything, & don't specify which port to forward. After doing a Google search for your router, assuming that the images are correct, you have to setup the service to forward. I have a Netgear v318, & this is how it's done. It also allows for port traffic logging, which I suggested & don't see that you tried. This validates the traffic, & is imo a good troubleshooting step, one that I've used.

Define the service with a port.
Add the service & port to the forwarding list.

Can you provide screen shots of your available services & port forwarding rules?


1. How do I NOT specify which port to forward? It requires a port number, Doesn't it? If not, My server and client sure does.

2. How do I "Setup the service to forward"? Didn't I already do this?

3. I hadn't tried logging just yet.

3. "Define the service with a port." - In portforwarding/porttriggering? Because I've done that.

4. Sure can!
Here are some (7) images of what my router offers:

Attached image(s)

  • Attached Image
  • Attached Image
  • Attached Image
  • Attached Image
  • Attached Image
  • Attached Image
  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#38 LunaRebirth  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 125
  • Joined: 21-March 13

Re: C++ and Winsock - Connecting Via Internet

Posted 17 October 2013 - 07:54 PM

Anyone?
Was This Post Helpful? 0
  • +
  • -

#39 jimblumberg  Icon User is online

  • member icon


Reputation: 3988
  • View blog
  • Posts: 12,301
  • Joined: 25-December 09

Re: C++ and Winsock - Connecting Via Internet

Posted 17 October 2013 - 08:50 PM

If you can't get you laptop to work when it is connected directly to the modem then posting a bunch of crap from your router won't do any good. Until you find out why the direct connection isn't working you have little to no chance of getting things to work with your router.

But one thing I do notice is that you still have one of the firewalls enabled in the router. Look at the 6th screen shot above. The SPI firewall is enabled and you have NAT filtering enabled.

The first thing I would do is setup the Default DMZ Server, read the router documentation to see how to use this feature. But be aware this server would then be directly connected to the Internet.


Jim
Was This Post Helpful? 0
  • +
  • -

#40 LunaRebirth  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 125
  • Joined: 21-March 13

Re: C++ and Winsock - Connecting Via Internet

Posted 18 October 2013 - 02:47 PM

Okay I disabled the SPI firewall and I changed the NAT filtering to open.

I then set up a Default DMZ server.
I tried checking if my ports were then open, and failed. They returned closed.

Next, I tried hooking my PC to the router (Ethernet), and it also failed.
Was This Post Helpful? 0
  • +
  • -

#41 no2pencil  Icon User is online

  • Dic Head
  • member icon

Reputation: 5167
  • View blog
  • Posts: 26,849
  • Joined: 10-May 07

Re: C++ and Winsock - Connecting Via Internet

Posted 18 October 2013 - 03:22 PM

View Postno2pencil, on 14 October 2013 - 03:26 AM, said:

There is always the possibility that your ISP does not allow port 23 traffic. Try a non-standard port (like 9999) & have you friend pass the port in the telnet command. telnet ip 9999


View PostLunaRebirth, on 17 October 2013 - 10:54 PM, said:

Anyone?

My apologies, but I've been incredibly the last 24 hours & have not had a chance to see the screen shots. Bumping your topic is a sure fire way to kill any enthusiasm that I had for helping out.

By the way, the screen shots are not familiar to me or my Router setup. I will look at them when I get a moment.
Was This Post Helpful? 0
  • +
  • -

#42 LunaRebirth  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 125
  • Joined: 21-March 13

Re: C++ and Winsock - Connecting Via Internet

Posted 18 October 2013 - 06:30 PM

Sorry, I had to bump the post. I'm looking forward to getting this working as soon as possible.
Every day, as I come home from work, I search and search and search on google for answers. But I find nothing that works.
So I'm here trying to ask, getting the feeling to give up
Was This Post Helpful? 0
  • +
  • -

#43 jimblumberg  Icon User is online

  • member icon


Reputation: 3988
  • View blog
  • Posts: 12,301
  • Joined: 25-December 09

Re: C++ and Winsock - Connecting Via Internet

Posted 19 October 2013 - 07:44 AM

Until you get this figured out you need to stick with the Ethernet connection. Once you get it working you can try to switch to the wireless connection. Keep it as simple as possible.

I also recommend that you download and install the Filezilla server on your "server". On your "client" (the remote computer) you download and install the client. Then once both the server and client have the software installed try using this program and see if you can connect. Be sure to download and read the Documentation for this software. There is a complete page on troubleshooting the Network connections that will probably be of great interest. I also recommend you enable the logging to a file, again see the documentation. This log file should be able to help determine where things are going wrong.

Using this known workable software you will eliminate another possible source of the problems.

And if you still have problems, fully describe the problem. Just saying it doesn't work doesn't tell us anything. What exactly are the indications that things are not working? Do you get any error messages? If so what exactly are these messages?


Jim
Was This Post Helpful? 0
  • +
  • -

#44 no2pencil  Icon User is online

  • Dic Head
  • member icon

Reputation: 5167
  • View blog
  • Posts: 26,849
  • Joined: 10-May 07

Re: C++ and Winsock - Connecting Via Internet

Posted 20 October 2013 - 03:19 PM

Just to bring me up to speed on this, I have two questions :

1.) Does it work on the internal network, from a 2nd machine to the 'server/service' machine (over telnet)?
2.) Did you ever verify with the ISP that they do in fact allow traffic on the desired port?
Was This Post Helpful? 0
  • +
  • -

#45 #define  Icon User is offline

  • Duke of Err
  • member icon

Reputation: 1305
  • View blog
  • Posts: 4,490
  • Joined: 19-February 09

Re: C++ and Winsock - Connecting Via Internet

Posted 28 October 2013 - 07:38 PM

Your internet address points to your network.

The router is the (default) gateway between the internet and your network.
Your router's address (gateway) appears to be 192.168.1.1

The computer on your network, that has the server program, is the server computer.
The server's address appears to be 172.16.0.? (the 192.168.?.? block would probably be ok)
The server's address is allocated bt DHCP, so it could change if there is more network devices other than the router and the server on the network.

With port forwarding, the image provided says that you should use Add Custom Service to add an application or game. You might need to click Apply at the top right to save.

How is Port Forwarding Configured?

Geek to Live: How to access a home server behind a router/firewall

List of TCP and UDP port numbers

Do you need to setup the static address.
Port Forwarding the Netgear WNR2000 Router for Minecraft Server
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3