I wrote a server and client Java TCP Socket, It works on private network(192.168.2.x) but how I have no idea how make it work with public ip. I think I should open a port in the router and use my server ip and this port to init client socket! I tried it and did not work.  Init of sockets here:  Socket clientSocket = new Socket(IP, PORT);  ServerSocket server = new ServerSocket(PORT);
123798
I have had no trouble getting the sockets working with localips, but once I made the code change to use public ips, I've consistently gotten java.net.ConnectException.  I am using the port 8084, which as far as I know, is not used elsewhere In the command prompt, netstat -a | grep 8084 shows: File STDIN:   TCP    user-9114eb19a8:8084    user-9114eb19a8:0      LISTENING  I have gone into my router and ensured that it is open I get my public ip using a request to   Server:  serverSocket = new ServerSocket (8084);   Client:  socket = new Socket (hostaddr, 8084); //hostaddr is a string containing my public-IP //it works when the program is run on a localnetwork and I am using my local-ips
34104
I made a server and used my IPv4 address for the IP. I decided to scratch that server and make a Bukkit server so I can use plugins. I tried to use my IPv4 address which I used for my other server but I keep getting the message [17:31:15 WARN]: ****FAILED TO BIND TO PORT!  Is there any thing I can do to get a new address to use or is there a way to delete the old server? Do I need to use a different computer? Please help! I've don't know how to fix this problem. If you have any suggestions please tell me and I'll give it a try.
100031
I have a little VPS I run apache and a Minecraft server on. I don't ever turn it off, but should I restart it for some reason, IPTables blocks most of my ports, including port 80. I've tried so many different suggestions on fixing this, but with no luck. Also, since the provider is OVH, the support is... lacking.  So, I've created a workaround, which I'm happy with. I created a simple shell script file to open certain ports I need opened on restart (80 and 25565 for now). The important ones such as 21 and 22 are not affected on restart.   The script looks like this:  iptables -I INPUT -p tcp --dport 80 -j ACCEPT iptables -I INPUT -p udp --dport 80 -j ACCEPT iptables -I INPUT -p tcp --dport 25565 -j ACCEPT iptables -I INPUT -p udp --dport 25565 -j ACCEPT /sbin/service iptables save   When I manually run it by typing /iptdef.sh, it runs fine, the ports become open and it's all good.  Of course, it's not practical having to remember to run it every time I restart the server, so I added a crontab. The problem is, it doesn't work/run. This is my crontab file:  */5 * * * * /backup2.sh */55 * * * * /backup3.sh @reboot /iptdef.sh * * * * *  /iptdef.sh   The first two lines work. They are just simple scripts that make a backup of a folder for me. The second two lines are what's not working.   Is there a chance that perhaps it's not possible to run iptables commands from a cron? It sounds silly, but I can't see any other reason for it not to work. The scripts have the correct permissions.
121600
so I'm having a client in my network connected to the router through my computer with arpspoof. When I know want to stop the packet forwarding I execute:  iptables -A FORWARD -j REJECT   that is working how I expected. But when I try to do something like:  iptables -A FORWARD -j ACCEPT   I cannot manage to make the packets go through like in the beginning.   Am I doing something wrong or are there any other arguments I should use different from "ACCEPT"?
67356
How would I set my webservers to work in way described below?   Http request: mypublic.com ---> handled normally by nginx as it is set up already (listen 80;) Http request: myprivate.com ---> handled by apache set up to work on 8080 (listen 8080)    I'd like to avoid including ports when typing address in browser, some kind of mockup (proxy?/squid?) at nginx. Both of domains are pointing to my machine and set up by named.
34547
I have an Apache server running on a Raspberry P and it works just fine in the local network. And after forwarding port 80 and trying to connect using the public IP, Chrome says ERR_CONNECTION_REFUSED. But the strange thing is that I CAN reach the server when using VPN and using the same IP. What can I do?     -telnet 80.***.***.78 80      Trying 80.***.***.78...     telnet: connect to address 80.***.***.78: Connection refused     telnet: Unable to connect to remote host     -route -n      Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0     192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0      -sudo netstat -lapute:              Active Internet connections (servers and established)     Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name     tcp        0      0 *:http                  *:*                     LISTEN      root       6137        2051/apache2     tcp        0      0 *:ssh                   *:*                     LISTEN      root       6367        2249/sshd     tcp        0      0 pi.local:ssh            nmb.local:65535         ESTABLISHED root       8669        2565/sshd: pi [priv     udp        0      0 *:9949                  *:*                                 root       5918        1809/dhclient     udp        0      0 *:mdns                  *:*                                 avahi      6293        2184/avahi-daemon:     udp        0      0 *:54070                 *:*                                 avahi      6295        2184/avahi-daemon:     udp        0      0 *:bootpc                *:*                                 root       5946        1809/dhclient     udp        0      0 pi.local:ntp            *:*                                 root       6310        2200/ntpd     udp        0      0 localhost:ntp           *:*                                 root       6309        2200/ntpd     udp        0      0 *:ntp                   *:*                                 root       6304        2200/ntpd
115270
Is a "port"  a communication endpoint (in the transport layer)?  Is a "port number"   an address assigned to a port?  Given a port, can we change the port number assigned to it, similar to that it is possible to change the IP address assigned to a network interface? From      sockets with TCP port 53 and UDP port 53 are distinct sockets   What does the quote mean? Specifically,   Can a port be used by two transport protocols (e.g. TCP and UDP) simultaneously? (My understanding is that a port is part of a transport protocol, and can't belong to another protocol even at a different time.) Does the quote mean that a port number 53 can be assigned to a port in TCP  and to a port in UDP at different times (but not simultaneously)?
38489
My setup  I have a linux server running in my basement. I currently have my router looking to that server for DNS lookup, so I can use named to spoof a bunch of domain names to point to my local server's local address, 192.168.0.111. This works great.  I also am running Apache and PHP on this server, and have forwarded port 80 on my router to this machine, so my public IP xx.xxx.x.xx is sent to the basement server.  This is a great development set up for me, because I can develop websites in my local network and pull them up on numerous devices with a *.mylocal.net address. I can also quickly share a website on my public IP with others that are outside of my network.  I have a static IP, so that makes this even easier.  The problem  Some applications need to have an absolute URL. My spoofed DNS doesn't work outside my network, and neither does my internal IP address.  I need to be able to access the sites at the same IP that they are accessed publicly, which is my public IP: xx.xxx.x.xx    For some reason, I can't access my own public IP address from within my own network.  My router's public IP is xx.xxx.x.xx, and when I hit xx.xxx.x.xx from outside my network I see exactly what I want -- my development website. But, when I hit xx.xxx.x.xx from inside my network, the connection times out.    I assume my ISP has a firewall that blocks requests from xx.xxx.x.xx to xx.xxx.x.xx where the origin and the destination are the same IP (or maybe this is impossible on any network?)  So how can I set up my network to forward the internal request to my public IP to the local IP of my basement server?   I would like to do this within the local DNS server I set up, or in my router, so the change can be applied to all devices in my network, and not just the basement server or the windows tablet/laptop, etc individually.
458
Could someone explain to me what a socket is? I see it in many acronyms in context of SSL, etc.  Also, why is it called a socket? Is it purely because it was what a name they invented? Or was it the first name they came up with?
96122
Ive set up an OpenVPN server at my place and handed out a certificate to a client who has an openvpn client at his place.  I need require that he should be able to connect to the vpn server only from one IP address (his current one).  How can I do this?
56660
I have purchased  a while back when I was connecting to my first ISP via ADSL.  Now, I have changed the ISP to a cable company and am having trouble setting up the router to connect to the new cable modem.  The Internet works, but only in bridge mode, i.e. my PC gets a public IP, and isn't part of the 192.168.1.0 network (and can't be accessed by other PCs in the network) which is what I want - I want the router to have the NAT and the clients behind it to have access to the Internet, but with 192.168.1.0 addresses.  The setup is pretty simple - from cable modem one network cable to router, from router another network cable to PC.  When I configure the router to use Encapsulation - Bridged (VC Mux), my PC gets the public IP and the Internet works. When I configure it to use a routed connection (either LLC or VC Mux) I do get the local IP but no Internet (regardless of the NAT setting)  The router also has diagnostics, status, ping etc, but nothing I change in the PVC settings enables the Internet.  Is what I'm trying even possible? If so, how can I do it? What am I missing?
26553
If yes, how does it work? The pc still has no ip, so where should I forward the port?
70118
My apologies if this has been asked before. I haven't found an adequate solution so... yeah.  When a specific domain, "example.com" is accessed, I want it to act normally. In other words, it should go to port 80 as expected and interact with Apache.  When a different sub-domain, "mc.example.com" is accessed, I don't want it to access the Apache web server. I want it to go interact with a different program, listening on, say, port 4096. Thus, going to "mc.example.com" would have the same/similar function as "example.com:4096". The service is Minecraft  When a third sub-domain, "vpn.example.com" is accessed, I want it to go interact with a different service, listening on, say, port 687. The service is openVPN  Is there a simple way to do this? If so, what is it? Does it involve configuring a VirtualBox in Apache (a method I tried and failed miserably. xD)? Or can it be done using ipTables? If it means anything, I am running 32-bit Centos 5.5(I believe. Its a recent version of Centos)
112958
Is it possible to redirect connections to a specific IP/port to an external IP/port?  Example:   Server A has the external IP xxx.xxx.xxx.xxx Server B has the external IP yyy.yyy.yyy.yyy User sends a request to server A on port 2106, I want to redirect it to server B at port 2106.
51728
This is my first time setting up a server and I've just installed a SSL cert. I have also made some changes to the iptable to allow access to 443. Below is the output of iptables -L   target     prot opt source         destination ACCEPT     all  --  anywhere       anywhere        state RELATED,ESTABLISHED ACCEPT     tcp  --  anywhere       anywhere        state NEW tcp dpt:http ACCEPT     icmp --  anywhere       anywhere ACCEPT     all  --  anywhere       anywhere ACCEPT     tcp  --  anywhere       anywhere        state NEW tcp dpt:ssh ACCEPT     tcp  --  anywhere       anywhere        state NEW tcp dpt:smtp ACCEPT     udp  --  anywhere       anywhere        state NEW udp dpt:smtp ACCEPT     tcp  --  anywhere       anywhere        tcp dpt:urd REJECT     all  --  anywhere       anywhere        reject-with icmp-host-prohibited ACCEPT     tcp  --  anywhere       anywhere        state NEW tcp dpt:https   I also checked nmap by ssh'ing into the server and run nmap from the server itself.  Starting Nmap 5.51 ( http://nmap.org ) at 2016-04-15 15:31 SGT Nmap scan report for &lt;my.domain.ip&gt; Host is up (0.0000050s latency). Not shown: 994 closed ports PORT     STATE SERVICE 22/tcp   open  ssh 25/tcp   open  smtp 80/tcp   open  http 443/tcp  open  https 3005/tcp open  deslogin 3031/tcp open  epic   When I tried telnet [my.domain.ip] 443 remotely  Trying &lt;my.domain.ip&gt;... telnet: connect to address &lt;my.domain.ip&gt;: Connection refused telnet: Unable to connect to remote host   Lastly, I do not know if nginx.conf plays a part but below is a snippet of the code for the ssl for the domain  #include /etc/nginx/conf.d/*.conf;  server {     listen          &lt;my.domain.ip&gt;:80;     server_name     mydomain.com www.mydomain.com;     index           index.html index.htm index.py;     access_log      /var/log/nginx/mydomain.com.log;     error_log       /var/log/nginx/mydomain.log.error;     root            /home/fr/;     charset         utf-8;      #error_page 500 502 503 504 /custom_50x.html;     #location = /custom_50x.html {     #        internal;     #}      location / {         uwsgi_pass  &lt;my.domain.ip&gt;:3031;         include     uwsgi_params;     }      location /static {         root        /home/fr/env/FRuler/fruler/;     } }  ### for ssl  ### server {     listen          &lt;my.domain.ip&gt;:80;     server_name     mydomain.com www.mydomain.com;     index           index.html index.htm index.py;     access_log      /var/log/nginx/mydomain.com.log;     error_log       /var/log/nginx/mydomain.log.error;     root            /home/fr/;     charset         utf-8;       location / {         uwsgi_pass  &lt;my.domain.ip&gt;:3031;         include     uwsgi_params;     }      location /static {         root        /home/fr/env/FRuler/fruler/;     } }  server {     listen 443 ssl;     server_name     mydomain.com www.mydomain.com;     ssl on;     ssl_certificate /etc/ssl/mydomain/ssl.crt;     ssl_certificate_key /etc/ssl/mydomain/server.key;     server_name mydomain www.mydomain.com;     access_log  /var/log/nginx/mydomain.com.log;     error_log   /var/log/nginx/mydomain.log.error;     location / {         root /home/fr/;         index index.html;     } } ### end of ssl ###   Any help is appreciated.
120446
I have questions about the way P2P works -   Do all p2p nodes need a server to connect them to each other ?  (For example, pptp is a p2p connection but it users a vpn server, while bittorrent is also a p2p system but it uses a tracker)  Do bittorrent clients use trackers to find the ips or does the traffic between clients goes through the trackers ?   Lastly - how do bitcoin clients find each other ?  Do they use something like a tracker ? (I have read on the bitcoin site that if we want to help the bitcoin network we can install bitcoin core on our server but the question is that how do they communicate with each other through the Internet.  Surely there needs  be main server to connect them  ? I have heard that there is an IRC server that send the clients the ip addresses for example)
36089
Goal: I want to be able to securely use the internet via my home PC while my notebook is connected to an open hotspot/access point.  I do know that I can use a SSH tunnel/SOCKS proxy, but I don't want to fiddle around with applications (making them use it, if even possible). I guess what I need is an OpenVPN setup, so I'm looking for a detailed guide on how to:   Install and setup the OpenVPN server Setup the OpenVPN client (NetworkManager)   Ubuntu versions this should work on are 10.10 and 11.04.