Answer the question
In order to leave comments, you need to log in
Why doesn't ip rule add fwmark work?
I set up several uplinks on the gateway.
The gateway also runs openvpn inside the lxc container (the network is organized through a bridge interface, which includes lxc network interfaces and physical eth0 looking at the LAN)
[email protected]:/etc/init.d# brctl show
bridge name bridge id STP enabled interfaces
br-eth0 8000.002191ef8b35 no eth0
vethGPYWS8
vethXGQ5EQ
lxcbr0 8000.000000000000 no
ip rule add from 192.168.128.13 lookup isc-ml
ip rule add from all fwmark 0x2 lookup isc-ml prio 1000
[email protected]:/home/sysadmin# ip rule list
0: from all lookup local
1000: from all fwmark 0x2 lookup isc-ml
32759: from all to 95.X.X.0/24 lookup isc-ml
32760: from 95.X.X.40 lookup isc-ml
32762: from all to 83.Y.Y.194 lookup isc-rt
32763: from 93.Y.Y.67 lookup isc-rt
32766: from all lookup main
32767: from all lookup default
Aug 14 13:01:30 gate kernel: [934528.016392] TRACE: mangle:PREROUTING:rule:2 IN=ethmiddle OUT= MAC=90:94:e4:82:0e:00:68:05:ca:0f:20:aa:08:00 SRC=93.Z.Z.117 DST=95.X.X.40 LEN=42 TOS=0x00 PREC=0x00 TTL=53 ID=8720 DF PROTO=UDP SPT=44619 DPT=1194 LEN=22 MARK=0x2
Aug 14 13:01:30 gate kernel: [934528.016425] TRACE: mangle:PREROUTING:rule:4 IN=ethmiddle OUT= MAC=90:94:e4:82:0e:00:68:05:ca:0f:20:aa:08:00 SRC=93.Z.Z.117 DST=95.X.X.40 LEN=42 TOS=0x00 PREC=0x00 TTL=53 ID=8720 DF PROTO=UDP SPT=44619 DPT=1194 LEN=22
Aug 14 13:01:30 gate kernel: [934528.016498] TRACE: nat:PREROUTING:rule:6 IN=ethmiddle OUT= MAC=90:94:e4:82:0e:00:68:05:ca:0f:20:aa:08:00 SRC=93.Z.Z.117 DST=95.X.X.40 LEN=42 TOS=0x00 PREC=0x00 TTL=53 ID=8720 DF PROTO=UDP SPT=44619 DPT=1194 LEN=22 MARK=0x2
Aug 14 13:01:30 gate kernel: [934528.016557] TRACE: mangle:FORWARD:policy:1 IN=ethmiddle OUT=ethmiddle MAC=90:94:e4:82:0e:00:68:05:ca:0f:20:aa:08:00 SRC=93.Z.Z.117 DST=192.168.128.13 LEN=42 TOS=0x00 PREC=0x00 TTL=52 ID=8720 DF PROTO=UDP SPT=44619 DPT=1194 LEN=22 MARK=0x2
Aug 14 13:01:30 gate kernel: [934528.016600] TRACE: filter:FORWARD:policy:12 IN=ethmiddle OUT=ethmiddle MAC=90:94:e4:82:0e:00:68:05:ca:0f:20:aa:08:00 SRC=93.Z.Z.117 DST=192.168.128.13 LEN=42 TOS=0x00 PREC=0x00 TTL=52 ID=8720 DF PROTO=UDP SPT=44619 DPT=1194 LEN=22 MARK=0x2
Aug 14 13:01:30 gate kernel: [934528.016633] TRACE: mangle:POSTROUTING:rule:1 IN= OUT=ethmiddle SRC=93.Z.Z.117 DST=192.168.128.13 LEN=42 TOS=0x00 PREC=0x00 TTL=52 ID=8720 DF PROTO=UDP SPT=44619 DPT=1194 LEN=22 MARK=0x2
iptables -t mangle -A PREROUTING -j CONNMARK --restore-mark
iptables -t mangle -A PREROUTING -m mark ! --mark 0 -j RETURN # if already set, we're done
iptables -t mangle -A PREROUTING -i ethmiddle -j MARK --set-mark 0x2
iptables -t mangle -A POSTROUTING -o ethmiddle -j MARK --set-mark 0x2
iptables -t mangle -A POSTROUTING -j CONNMARK --save-mark
iptables -t nat -A PREROUTING -d $XINETIP -p UDP --dport 1194 -j DNAT --to-destination $VPNSERVER:1194
00:00:07.106369 IP (tos 0x0, ttl 53, id 16663, offset 0, flags [DF], proto UDP (17), length 42)
93.Z.Z.117.43148 > 95.X.X.40.openvpn: [udp sum ok] UDP, length 14
00:00:00.000056 IP (tos 0x0, ttl 52, id 16663, offset 0, flags [DF], proto UDP (17), length 42)
95.X.X.40.43148 > openvpn.cvision.lab.openvpn: [udp sum ok] UDP, length 14
00:00:00.000000 IP (tos 0x0, ttl 53, id 41756, offset 0, flags [DF], proto UDP (17), length 42)
93.Z.Z.117.57380 > 95.X.X.40.openvpn: [udp sum ok] UDP, length 14
00:00:00.000832 IP (tos 0x0, ttl 63, id 43790, offset 0, flags [DF], proto UDP (17), length 54)
95.X.X.40.openvpn > 93.Z.Z.117.57380: [udp sum ok] UDP, length 26
00:00:00.044444 IP (tos 0x0, ttl 54, id 41767, offset 0, flags [DF], proto UDP (17), length 50)
93.Z.Z.117.57380 > 95.X.X.40.openvpn: [udp sum ok] UDP, length 22
00:00:00.000089 IP (tos 0x0, ttl 54, id 41768, offset 0, flags [DF], proto UDP (17), length 142)
93.Z.Z.117.57380 > 95.X.X.40.openvpn: [udp sum ok] UDP, length 114
...
95.X.X.40.43148 > openvpn.cvision.lab.openvpn: [udp sum ok] UDP, length 14
Answer the question
In order to leave comments, you need to log in
if there is authorization - generally easy, if not - store the ip from which the user comes in, this of course will not be an accurate metric, but + - will make it clear how many uniques there are.
Look at the IP address. Also read about HTTP ETag, in case it is supported by the application.
SOLUTION SEE. BELOW. Thanks to everyone who tried to figure it out.
There is
[email protected]:/etc/init.d# ip ro sh ta isc-ml
default via 95.X.X.1 dev ethmiddle
Aug 14 11:56:30 gate kernel: [930628.627386] IPv4: martian source 192.168.128.13 from 93.Z.Z.117, on dev ethmiddle
Aug 14 11:56:39 gate kernel: [930636.846542] IPv4: martian source 192.168.128.13 from 93.Z.Z.117, on dev ethmiddle
Aug 14 11:56:54 gate kernel: [930652.586677] IPv4: martian source 192.168.128.13 from 93.Z.Z.117, on dev ethmiddle
Aug 14 11:57:08 gate kernel: [930665.944650] ll header: 00000000: ff ff ff ff ff ff 4c b1 6c 42 d1 7c 08 06 ......L.lB.|..
Aug 14 11:57:22 gate kernel: [930680.503274] ll header: 00000000: ff ff ff ff ff ff 4c b1 6c 42 d1 7c 08 06 ......L.lB.|..
Aug 14 11:57:26 gate kernel: [930684.060642] IPv4: martian source 192.168.128.13 from 93.Z.Z.117, on dev ethmiddle
Aug 14 11:57:32 gate kernel: [930690.082268] ll header: 00000000: ff ff ff ff ff ff 4c b1 6c 42 d1 7c 08 06 ......L.lB.|..
Aug 14 11:57:32 gate kernel: [930690.813437] IPv4: martian source 192.168.128.13 from 93.Z.Z.117, on dev ethmiddle
Aug 14 11:58:04 gate kernel: [930721.847001] ll header: 00000000: ff ff ff ff ff ff 00 25 22 89 80 df 08 00 .......%".....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question