Closed Thread
Results 1 to 4 of 4

Thread: iptables

  1. #1
    h4x Guest

    iptables

    i want to do something, so if i recive a connection request i will forward it to other host (with ip and port changed to local machine) and do that will all traffic.
    the tunnel, or more like proxy.


    i conenct to A, A conenct to B, B send to A, A send to me.
    i want to do it with changing port and ip, and like to know how to do it transparently (ip/port stay same).

    iptables are my goal, not custom ****-app. or c code.



    thx

  2. CODECALL Circuit advertisement

     
  3. #2
    Red_Shadow's Avatar
    Red_Shadow is offline Learning Programmer
    Join Date
    Jan 2009
    Location
    over the rainbow
    Posts
    58
    Rep Power
    0

    Re: iptables

    "The only means of strengthening one's intellect is to make up one's mind about nothing - to let the mind be a thoroughfare for all thoughts." -- John Keats

  4. #3
    onus is offline Programmer
    Join Date
    Sep 2010
    Posts
    111
    Rep Power
    0

    Re: iptables

    Linux Packet Filtering and iptables - DNAT target
    Port forwarding for iptables (DMZ)
    in this case I am forwarding port 22 to an internal machine 192.168.1.50
    Code:
    iptables -A PREROUTING -t nat -i eth1 -p tcp --dport 22 -j DNAT --to 192.168.1.50:22
    iptables -A INPUT -p tcp -m state --state NEW --dport 22 -i eth1 -j ACCEPT
    You will have to write one more rule in your FORWARDING table as well.

  5. #4
    onus is offline Programmer
    Join Date
    Sep 2010
    Posts
    111
    Rep Power
    0

    Re: iptables

    Like this
    Code:
    iptables -A FORWARD -i eth0 -d 192.168.0.50 -p tcp --dport 22 -j ACCEPT

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help with iptables, 2 nic's + 2 subnets
    By BHReach in forum Linux Networking
    Replies: 7
    Last Post: 06-22-2009, 10:55 PM
  2. IPtables
    By LissaValerian in forum Linux/Unix General
    Replies: 4
    Last Post: 07-01-2008, 08:18 AM
  3. Tutorial: IPTABLES - Linux Firewall Configuration
    By Jordan in forum Linux Tutorials, Guides and Tips
    Replies: 2
    Last Post: 06-20-2008, 09:57 AM

Tags for this Thread

Bookmarks

Posting Permissions

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