arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iptables problem solving
#2
Your iptables rule allows connections from client port 9022 to server port 9022. However clients that connect to the server usually have a random port and hitting 9022 as its client port is a odd of 1 to 65535. The last rule you executed blocks all other connections. So you cannot connect to your VPS unless your client port is 9022.

Use the emergency console or emergency VNC in your control panel and delete all rules using:
iptables -F
iptables -X

The correct rule to open port 9022 (TCP I assume) would be:
iptables -A INPUT -p tcp --dport 9022 -j ACCEPT


You should be watching out what you are doing! If you set your INPUT chain to DROP make sure you have setup iptables rules properly or you will lock out yourself like you did.

You also need some more rules if you plan to leave the INPUT chain on dropped. Rules that allow replies to connections that you have started and etc.

See here: https://post4vps.com/Thread-Basic-secure...h-iptables

If you want to set this up properly do it over the emergency SSH / VNC so you can test if it works without being locked out.
[Image: zHHqO5Q.png]
lockThread Closed 


Messages In This Thread
iptables problem solving - by chanalku91 - 07-22-2019, 07:35 AM
RE: iptables problem solving - by Mashiro - 07-22-2019, 09:55 AM
RE: iptables problem solving - by chanalku91 - 07-22-2019, 11:29 AM
RE: iptables problem solving - by Mashiro - 07-22-2019, 12:04 PM
RE: iptables problem solving - by chanalku91 - 07-22-2019, 12:25 PM
RE: iptables problem solving - by Mashiro - 07-22-2019, 12:30 PM
RE: iptables problem solving - by deanhills - 07-22-2019, 05:05 PM
RE: iptables problem solving - by chanalku91 - 07-22-2019, 12:38 PM
RE: iptables problem solving - by deanhills - 07-28-2019, 03:51 AM

Possibly Related Threads…
Thread
Author
Replies
Views
Last Post
2,514
10-14-2019, 01:31 PM
Last Post: hamed
3,466
07-29-2019, 05:02 AM
Last Post: humanpuff69

person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting