NAT SNAT DNAT Problems New to IPTABLES and linux networking

By jccurtis
Jan 4, 2006
  1. Okay I am totally new to IPTables and networking in Linux. I have a linux box hooked to my network and want to change the source and destination address of certain packets for VOIP purposes. All I have done so far is created a script for IPTables and activated it, but it doesnt seem to do anything. Here is my script as follows:


    iptables -t filter --flush
    iptables -t nat --flush
    iptables -t mangle --flush

    iptables -t filter --delete-chain
    iptables -t nat --delete-chain
    iptables -t mangle --delete-chain

    iptables --policy INPUT DROP
    iptables --policy OUTPUT DROP
    iptables --policy FORWARD DROP
    iptables -t nat --policy POSTROUTING ACCEPT
    iptables -t nat --policy PREROUTING ACCEPT

    iptables -A INPUT -i lo -j ACCEPT
    iptables -A OUTPUT -o lo -j ACCEPT

    iptables -F PREROUTING
    iptables -A POSTROUTING -p all -s -o eth0 -j SNAT --to
    iptables -A PREROUTING -p all -d -i eth0 -j DNAT --to

    service iptables status

    Okay, How do I check to see if Network Filtering is turned on and do I need to use IP forwarding? Any help appreciated...


    Justin Curtis
  2. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    What exactly do you want to do? Are you sure it's not IP masquerading you want?
  3. jccurtis

    jccurtis TS Rookie Topic Starter

    I want to change the Destination and Source address of Certain Packets

    I am losing certain packets when I try to access a remote network from my house. This is because there is a router in between that I do not have access to and it is blocking my packets because they are not on its network. I want to change the destination and source address of certain packets before they cross that router so they can make it back over to my network.
Topic Status:
Not open for further replies.

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...