Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I am trying to open VNC ports(5901,5902) on my RHLinux machine using iptables. I am able to do it from GUI system-config-security. Go to the Administration > Security Level ...
  1. #1
    Just Joined!
    Join Date
    Aug 2006
    Posts
    25

    open ports using iptables from terminal

    Hi,

    I am trying to open VNC ports(5901,5902) on my RHLinux machine using iptables.

    I am able to do it from GUI system-config-security. Go to the Administration > Security Level and Firewall, then select "other ports" at the bottom and enter the portNum 5901 to open and select tcp, then click OK and OK again to save your settings.
    From my windows m/n iam able to open vncsession using vncviewer on 5901 port.

    But when I am trying to do it from command line:
    #iptables -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
    This command added the entry in /etc/sysconfig/iptables and listed in iptables -L command.
    Then I saved and restarted the iptables.
    #service iptables save
    #service iptables restart

    When I am trying to open the VNC session from vncviewer, it is giving me error and session not opened.

    Is there some thing I missed here? where can I check the logs for this? I definetly need this to be done from command line only. So please suggest me some idea to fix this.

    Thanks in advance.

  2. #2
    Just Joined!
    Join Date
    Aug 2006
    Posts
    25
    Hi,

    I got it.

    Actually the entry I made is at the end of the file /etc/sysconfig/iptables (i.e. after REJECT all entry).
    I moved my entry just above that line and restarted iptables. Everything looks fine.

    Thanks,
    Uday

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...