Networking Forums

Networking Forums > Computer Networking > Linux Networking > one-to-one mapping using IPTABLES with LOG.

Reply
Thread Tools Display Modes

one-to-one mapping using IPTABLES with LOG.

 
 
baruah
Guest
Posts: n/a

 
      01-22-2005, 09:33 AM
Hello,
I want to implement one-to-one mapping of ip addresses using
iptables with logging.

Network is as follows:

-----192.168.1.0/24-----FIREWALL(IPTABLES)-----192.168.4.0/24
(Net-I)[eth0] (Net-II)[eth1]

I want each ip in Net-I when goes out through the firewall takes a
IP from Net-II. I think for it the following rule is sufficient.

Rule -I
###iptables -t nat -A POSTROUTING -o eth1 -s 192.168.1.1/32 -SNAT -to
192.168.4.1
Note: I want it to be static mapping.

Now, I also want to enable logging for the net-I(192.168.1.0/24)i.e.
keep track of who is doing what.

Will the following rule set work if I put instead of Rule-I?

#iptables -t nat -N LOG-TCP
#iptables -t nat -A POSTROUTING -p tcp -s 192.168.1.1/32
-m state --state NEW -j LOG-TCP
#iptables -t -A LOG-TCP -j LOG --log-tcp-options
--log-ip-options --log-prefix "[OUT-TCP-CONNECTIONS]:"
#iptables -t nat -A LOG-TCP -o eth1 -j SNAT -to 192.168.1.4
Any suggestions ?


thanks and regards
baruah

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Port Mapping with iptables? Allan Bruce Linux Networking 2 12-19-2005 06:37 PM
Looking for iptables applications code (iptables.c) to run some rules to forward packets tvnaidu@yahoo.com Linux Networking 2 01-17-2005 05:01 PM
NAT: 1-1 mapping from 192.168.x.x to 10.168.x.x ? Stefano Masini Linux Networking 1 09-01-2004 01:26 AM
iptables "can't initialize iptables table `filter'" pete Linux Networking 1 10-10-2003 03:44 AM
Mapping ruben armas Windows Networking 0 07-07-2003 04:43 PM



1 2 3 4 5 6 7 8 9 10 11