Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

- - - - -

iptables

networking

  • Please log in to reply
3 replies to this topic

#1 Guest_h4x_*

Guest_h4x_*
  • Guest

Posted 11 October 2009 - 03:34 PM

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
  • 0

#2 Red_Shadow

Red_Shadow

    CC Resident

  • Just Joined
  • PipPipPipPip
  • 50 posts

Posted 02 August 2010 - 09:18 AM

Read this: Iptables Tutorial 1.2.2
  • 0
"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

#3 onus

onus

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 113 posts

Posted 29 October 2010 - 02:27 AM

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
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.
  • 0

#4 onus

onus

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 113 posts

Posted 29 October 2010 - 02:31 AM

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

  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download