[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Selecting source ip


you could use iptables with SNAT to change your source ip.
in combination with the owner match module you could eg match packets
generated by specific pid or uid.

OWNER match v1.2.7a options:
[!] --uid-owner userid     Match local uid
[!] --gid-owner groupid    Match local gid
[!] --pid-owner processid  Match local pid
[!] --sid-owner sessionid  Match local sid
[!] --cmd-owner name       Match local command name

should work for a ping:
iptables -t nat -A POSTROUTING -m owner --cmd-owner ping -j SNAT
--to-source a.b.c.d


On Mit, 2003-05-28 at 23:02, Stefan Neufeind wrote:
> Hi,
> when I request a file from a linux box using lynx the source ip of my 
> request is the ip of eth0. But how can I change the source ip to 
> other ips which are also bound to eth0 (via eth0:0 etc.)? Do I need 
> to change the default gate from eth0 to eth0:0 for example? Isn't 
> there a way to just change the source ip for all programs I will 
> execute in my current environment / bash without affecting other 
> programs / tasks?
> Yours sincerely,
>  Stefan

Reply to: