• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 916
  • Last Modified:

how to enable ports via command line ?

I have a dedicated server that i used to be able to connect via remote desktop connection. However, I was trying to add a port number to be enabled and I beleive I accidentally shut down all ports.

I did that via control panel-> network connections -> properties of the connection there(Internet Connection (TCP/IP), then clicked on advanced and then under options tab, i clicked properties.

I selected permit only under tcp ports and added in port number. then rebooted the system.

so after that the web application that is on the server is not accessible and cant connect to it via remote connect.

however, I am able to connect to the server through sth called the serial console.

using the following code:
TcpScan.Connect("server", Port#);
it shows that port 80, 3389 as closed.

I have disabled the firewall and the ipsec service

so my question is how can i enable the ports via command line as thats the only way to connect to the server now, or what can be done to help establish connection again with the server.

thanks in advance.
0
stech08
Asked:
stech08
  • 2
  • 2
1 Solution
 
Henrik JohanssonSystems engineerCommented:
Run the following command:
sc stop ipnat

It's by default automatic, so it will start again at next reboot.
0
 
stech08Author Commented:
I recieved the following message:

"[SC] ControlService FAILED 1062:

The service has not been started."

thanks though.. anything else i can do?
0
 
Henrik JohanssonSystems engineerCommented:
Reset TCP/IP configuration with the following command and reboot. Make sure you have DHCP available for that subnet before rebooting. Otherwise, you nead to go and find the console when the server doesn't have IP-address configured after reboot.

netsh int ip reset
0
 
stech08Author Commented:
That did it, I cant thank you enough.
I had to restart and it worked.

Thanks again.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now