1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Firewall iptables, what is the rule to allow server additional ips?

Discussion in 'Site & Server Administration' started by basketmen, Nov 15, 2015.

  1. #1
    I have 5 ips
    1.1.1.1
    1.1.1.2
    1.1.1.3
    1.1.1.4
    1.1.1.5

    i already install openvz & openvz webpanel in main ip
    then create a vps with ip 1.1.1.2

    i cant open 1.1.1.2 in browser address & ssh, but if i disable iptables firewall, i can open it
    so i need to enable iptables firewall, what is the rule so i can to allow the server additional ips (1.1.1.2-1.1.1.5) in /etc/sysconfig/iptables ?

    i tried these but still not right



    please help guys
     
    Last edited: Nov 15, 2015
    basketmen, Nov 15, 2015 IP
  2. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #2
    Which server are you modifying the iptables configuration, the main host (1.1.1.1) or the container (1.1.1.2)?

    Regards,
    Chris
     
    RHS-Chris, Nov 15, 2015 IP
  3. samirj09

    samirj09 Well-Known Member

    Messages:
    335
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    125
    #3
    Hi,

    Try this:
    
    iptables -I INPUT -p tcp --dport 22 -j ACCEPT
    iptables -I INPUT -p tcp --dport 80 -j ACCEPT
    
    Code (markup):
    I believe your previous rules would not have worked as you are specifying the source IP as 1.1.1.2, but it is actually the destination. It is much easier to just open the ports required without specifying the IP address.
     
    samirj09, Nov 15, 2015 IP