Sponsored Content
Special Forums IP Networking Proxy Server iptables as "proxy" and a filter Post 302926601 by tschulian on Tuesday 25th of November 2014 12:07:03 PM
Old 11-25-2014
iptables as "proxy" and a filter

Dear community,
since I am a german guy, excuse gramatical mistakes.

I create a proxy to hide my application servers public IP from my customers.
I am actually using those 3 lines
(for testing reasons I am forwarding the traffic which connects to the ubuntu proxy to my apache webserver (5.196.130.245:80)

Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 5.196.130.245:80
iptables -t nat -A POSTROUTING -j MASQUERADE

I show this to a friend/competitor and he said, lol, with this code ur "hiding" the costumers IP in ur Database logs
(for example, they use the register formular on the website username, password registerIP - and with my 3 lines of code the register IP is the proxys IP in every single case but he told me he got a way to see even the real Users IP, even if they connecting through the proxy)

So he sent me the following Picture of his script
Image

Any1 knows / is able to describe me what he has done better / other than me? I cannot see any routing cmds in his script.

I'm now almost searching 5 days for a solution and this is my last hope to find it.


EDIT: okay, I just found out that this Script for setting up the iptables is not for forwarding any traffic.
For the redirecting/forwarding part he is using HAPROXY.

regards,
Julian

Last edited by tschulian; 11-25-2014 at 04:13 PM.. Reason: code tags not icode ... thanks
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. Solaris

The slices "usr", "opt", "tmp" disappeared!!! Help please.

The system don't boot. on the screen appears following: press enter to maintenance (or type CTRL-D to continue)...I checked with format command. ... the slices "0-root","1-swap","2-backup" exist. ...the slises "3-var","6-usr" -unassigned. :( (16 Replies)
Discussion started by: wolfgang
16 Replies

5. Shell Programming and Scripting

Filter file by length, looking only at lines that don't begin with ">"

I have a file that stores data in pairs of lines, following this format: line 1: header (preceded by ">") line 2: sequence Example.txt: >seq1 name GATTGATGTTTGAGTTTTGGTTTTT >seq2 name TTTTCTTC I want to filter out the sequences and corresponding headers for all sequences that are less... (2 Replies)
Discussion started by: pathunkathunk
2 Replies

6. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

7. UNIX for Dummies Questions & Answers

Grep : Filter/Move All The Lines Containing Not More Than One "X" Character Into A Text File

Hi All It's me again with another huge txt files. :confused: What I have: - I have 33 huge txt files in a folder. - I have thousands of line in this txt file which contain many the letter "x" in them. - Some of them have more than one "x" character in the line. What I want to achieve:... (8 Replies)
Discussion started by: Nexeu
8 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
IFNDP-PROXY(5)						       Network configuration						    IFNDP-PROXY(5)

NAME
ifndp-proxy[-<interface name>] - IPv6 NDP and IPv4 ARP proxy entries SYNOPSIS
/etc/sysconfig/network/ifndp-proxy /etc/sysconfig/network/ifndp-proxy-<interface name> DESCRIPTION
These files contain IPv6 NDP and IPv4 ARP proxy settings, that should be applied using the ip neigh add proxy command documented in the ip(8) manual page that provides a common interface for IPv4 and IPv6. The NDP/ARP proxy is required, e.g. when IP addresses from the same subnet have to be used on the interface of the host as well as on interfaces behind a (tunnel) interface and using a bridge is not an option. Don't forget to enable forwarding and the NDP/ARP proxy by setting net.ipv6.conf.<all|default|interface name>.proxy_ndp = 1 net.ipv6.conf.<all|default|interface name>.forwarding = 1 and/or net.ipv4.conf.<all|default|interface name>.proxy_arp = 1 net.ipv4.conf.<all|default|interface name>.forwarding = 1 or net.ipv4.ip_forward = 1 either as global all setting in the /etc/sysctl.conf file or using the ifsysctl(5) files, that allow per-interface setup. Forwarding can be also enabled in the /etc/sysconfig/sysctl file using the IP_FORWARD and IPV6_FORWARD variables. The proxy entries are added and deleted using the if-{up|down}.d/ndp-proxy script, every time after an involved interface has been set up or down. SYNTAX
The format of the ifndp-proxy file is: <address> <address interface> <proxy interface list> The format of the ifndp-proxy-<address interface> file is same to above, but allows also to omit the address interface by using a "-" as placeholder inside of the file, because it is already available in the file name: <address> <address interface | -> <proxy interface list> Lines beginning with # and blank lines are ignored. Each line defines to add a proxy NDP/ARP entry with the address of or behind address interface to all interfaces in the proxy interface list. EXAMPLES
Let's assume, your machine is connected via eth0 to a switch with the networks 2001:db8:abba::/64 and 192.168.100.1/24 and is using the IP address 1 itself. You'd like to use the addresses 11 and 12 e.g. for virtual machines behind the tap1 and tap2 interface, that is: 2001:db8:abba::1/64 -- local eth0 address 2001:db8:abba::11/64 -- address behind tap1 2001:db8:abba::12/64 -- address behind tap2 192.168.100.1/24 -- local eth0 address 192.168.100.11/24 -- address behind tap1 192.168.100.12/24 -- address behind tap2 then set up the following entries in the ifndp-proxy file: 2001:db8:abba::1 eth0 tap1 tap2 2001:db8:abba::11 tap1 eth0 tap2 2001:db8:abba::12 tap2 eth0 tap1 192.168.100.1 eth0 tap1 tap2 192.168.100.11 tap1 eth0 tap2 192.168.100.12 tap2 eth0 tap1 additionally to the routing entries in the routes or ifroute-<interface name> files. BUGS
Please report bugs at <https://bugzilla.novell.com/> AUTHOR
Marius Tomaschewski <mt@suse.de> SEE ALSO
ifup(8) ifcfg(5) ifsysctl(8) sysconfig December 2009 IFNDP-PROXY(5)
All times are GMT -4. The time now is 09:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy