12-08-2010
Iptables to change source IP
Hey everyone!
I am trying to configure iptables/netfilter so that all traffic coming from a certain port (8001) has its source ip re-written as a different ip. Can this be done?
Basically its a possible workaround for another issue I'm having with a multihomed server. SNMP data is coming in on one IP, and they're being responded to using the incorrect IP. So, I need all packets sent from the snmp agent to have the source ip re-written as the correct source ip. Any ideas?
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i'm installing qt from source, and while making i get an error having to do with a "pthread library." what libraries do i need to install for qt to compile, and where can i get them? (1 Reply)
Discussion started by: nydel
1 Replies
2. UNIX Desktop Questions & Answers
I need to change the time on my SUN box, it is five minutes fast. (4 Replies)
Discussion started by: michelemcdonald
4 Replies
3. Shell Programming and Scripting
What's the difference of using "." and "source", such as
". .bashrc" and "source .bashrc"? (1 Reply)
Discussion started by: learn
1 Replies
4. Shell Programming and Scripting
I have a script in /etc/rc2.d that needs to run on boot up
the file looks like this
#!/sbin/sh
source /abc/scripts/test_env.sh
/abc/xyz/run
I need to source the test_env.sh script they are both bash how do i do that?
'source /abc/scripts/test_env.sh'
I am not too sure (3 Replies)
Discussion started by: deaconf19
3 Replies
5. Shell Programming and Scripting
Hi all,
I have this source file source.txt :
hdrEthernetSwitch1IPAddress 112.13.9.34
hdrEthernetSwitch2IPAddress 112.13.8.245
noOfRevASLAvailable 8000
noOfRevASLInUse 122
maxDOSPayload 7777
pcmdEvdoRUM Enabled
pcmdEvdoFlow Enabled
And I have this datafile to be modified :
... (5 Replies)
Discussion started by: luna_soleil
5 Replies
6. Shell Programming and Scripting
I have 100 files in a directory , all the files have a word "error" and they are created in different date . Now I would like to change the word from "error" to "warning" , and keep the date of the files ( that means do not change the file creation date after change the word ) , can advise what can... (0 Replies)
Discussion started by: ust3
0 Replies
7. Shell Programming and Scripting
I have 100 files in a directory , all the files have a word "error" and they are created in different date . Now I would like to change the word from "error" to "warning" , and keep the date of the files ( that means do not change the file creation date after change the word ) , can advise what can... (7 Replies)
Discussion started by: ust3
7 Replies
8. IP Networking
Hi,
Environment:
Linux: Ubuntu 12.04
I am connected to internet using static ip. This means my internet provider Pacenet has assigned me static ip. Now, whenever I am trying to change source ip for tcp/ip (ip4) using iptables firewall, I am unable to access internet at all.
Can anybody... (4 Replies)
Discussion started by: ashv
4 Replies
9. SCO
Hello
I'm trying to virtualize an instance of Sco Unix 5.0.5 in VirtualBox (called VM-A) , but sco I have problems set to launch with the new raid controller .
The physical machine has a raid controller adaptec (alad driver) but VirtualBox uses buslogic (blc driver)
What ... (3 Replies)
Discussion started by: flako
3 Replies
Firewall mark classifier in tc(8) Linux Firewall mark classifier in tc(8)
NAME
fw - fwmark traffic control filter
SYNOPSIS
tc filter ... fw [ classid CLASSID ] [ action ACTION_SPEC ]
DESCRIPTION
the fw filter allows to classify packets based on a previously set fwmark by iptables. If it is identical to the filter's handle, the fil-
ter matches. iptables allows to mark single packets with the MARK target, or whole connections using CONNMARK. The benefit of using this
filter instead of doing the heavy-lifting with tc itself is that on one hand it might be convenient to keep packet filtering and classifi-
cation in one place, possibly having to match a packet just once, and on the other users familiar with iptables but not tc will have a less
hard time adding QoS to their setups.
OPTIONS
classid CLASSID
Push matching packets to the class identified by CLASSID.
action ACTION_SPEC
Apply an action from the generic actions framework on matching packets.
EXAMPLES
Take e.g. the following tc filter statement:
tc filter add ... handle 6 fw classid 1:1
will match if the packet's fwmark value is 6. This is a sample iptables statement marking packets coming in on eth0:
iptables -t mangle -A PREROUTING -i eth0 -j MARK --set-mark 6
SEE ALSO
tc(8), iptables(8), iptables-extensions(8)
iproute2 21 Oct 2015 Firewall mark classifier in tc(8)