Find the answer to your Linux question:
Results 1 to 4 of 4
Hi all, please help how can i open a secific port at specific ip using iptables on my Gateway n Firewall server. eg port 6900 for 217.140.24.41. we are using ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2004
    Posts
    2

    hellp.... opening specific port on specific ip at iptables


    Hi all,

    please help how can i open a secific port at specific ip using iptables on my Gateway n Firewall server. eg port 6900 for 217.140.24.41.
    we are using Rethat with iptables.
    anyone know ?

    Thanks for helping,


    Bunyamin

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    How do you mean "open"? Do you mean let traffic through to local (that is, on the same system) services, or forward traffic through to another node?

  3. #3
    Just Joined!
    Join Date
    Jun 2004
    Posts
    2
    Hi Mr. moderator,

    yes forward traffic through to another node, outside our local network.

    thanks for helping,



  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast Opnosforatou's Avatar
    Join Date
    Dec 2003
    Location
    Vleuten, The Netherlands
    Posts
    552
    Code:
    UNPRIVPORTS="1024:65535"
    PRIVPORTS="0:1023"
    SETTLERS_PORT="7176"
    INTERNETIP="xxx.xxx.xxx.xxx" (Replace with you internet IP address."
    DESTINATION_IP="xxx.xxx.xxx.xxx" (Replace with IP of target address)
     
    
    iptables -t nat -A PREROUTING -i ppp0 -p tcp --sport $UNPRIVPORTS -d $INTERNET_IP --dport $SETTLERS_PORT -j DNAT --to-desti
    nation $DESTINATION_IP
    
    iptables -A FORWARD -i ppp0 -o eth0 -p tcp --sport $UNPRIVPORTS -d $DESTINATION_IP --dport $SETTLERS_PORT -m state --state NEW -j ACCEPT
    I'm asuming the following:

    ppp0 is your internet interface
    eth0 is you local network.

    These rules forward and allow you to play the game, and host, Settlers 3D from behind you firewall.

    Good luck.

    Some handy reading:

    Linux Advanced Routing & Traffic Control HOWTO
    Iptables Tutorial 1.1.19
    IPtable.org


    ---[ MS09-99896 - Vulnerability in All MS Windows OS ; Using Windows Could Allow Remote Code Execution. ]---
    Hardware: Asus P4P800, 1GB, P4-3Ghz, Asus V9950, Maxtor ATA HD\'s, 3Com GBit lan, Audigy ZS Plat.

Posting Permissions

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