NAT SNAT DNAT Problems New to IPTABLES and linux networking

Status
Not open for further replies.
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:

#!/bin/bash


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 10.22.92.111 -o eth0 -j SNAT --to 172.24.9.211
iptables -A PREROUTING -p all -d 172.24.9.211 -i eth0 -j DNAT --to 10.22.92.111

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

Thanks,

Justin Curtis
 
What exactly do you want to do? Are you sure it's not IP masquerading you want?
 
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.
 
Status
Not open for further replies.
Back