LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-02-2015, 07:16 PM   #1
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 581

Rep: Reputation: 38
iptables not setting UID for packet marking


Hi,

I'm trying to set up a shorewall firewall on a new NethServer (based on CentOS) and having an issue with routing packets based on a user. Eventually, after running out of all other ideas I finally ran an iptables capture. Once I did this, it was obvious why my rules weren't working. The UID field in all the traces show as 0:
Code:
Jul  2 13:05:23 NethServer kernel: TRACE: raw:OUTPUT:policy:2 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507 
Jul  2 13:05:23 NethServer kernel: TRACE: mangle:OUTPUT:rule:1 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507 
Jul  2 13:05:23 NethServer kernel: TRACE: mangle:OUTPUT:rule:2 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507 
Jul  2 13:05:23 NethServer kernel: TRACE: mangle:tcout:return:10 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507 
Jul  2 13:05:23 NethServer kernel: TRACE: mangle:OUTPUT:policy:3 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507 
Jul  2 13:05:23 NethServer kernel: TRACE: nat:OUTPUT:policy:1 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507 
Jul  2 13:05:23 NethServer kernel: TRACE: filter:OUTPUT:rule:2 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507 
Jul  2 13:05:23 NethServer kernel: TRACE: filter:eth0_out:rule:3 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507 
Jul  2 13:05:23 NethServer kernel: TRACE: filter:fw2net:return:6 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507
Jul  2 13:05:23 NethServer kernel: TRACE: mangle:POSTROUTING:rule:1 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507 
Jul  2 13:05:23 NethServer kernel: TRACE: mangle:tcpost:return:1 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507 
Jul  2 13:05:23 NethServer kernel: TRACE: mangle:POSTROUTING:policy:2 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507 
Jul  2 13:05:23 NethServer kernel: TRACE: nat:POSTROUTING:rule:1 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507 
Jul  2 13:05:23 NethServer kernel: TRACE: nat:eth0_masq:rule:1 IN= OUT=eth0 SRC=192.168.0.12 DST=173.194.72.113 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=ICMP TYPE=8 CODE=0 ID=15977 SEQ=1 UID=0 GID=507
This was a simple "ping google.com" from a regular user that gives up this for id:
Code:
[plex@NetServer ~]$ id
uid=(506)plex gid=(507)plex groups=507(plex),502(locals) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
Any ideas why UID is zero or how to fix this.

Cheers.
 
Old 07-02-2015, 08:10 PM   #2
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 581

Original Poster
Rep: Reputation: 38
Ha. Let me answer my own question here. I was running ping as the test, which I now find out is flagged as "setuid", so it effectively runs as root, hence UID=0. Guess I need to find another program to test with.

Cheers.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
simple tunnel with packet marking dorian33 Programming 0 03-19-2014 09:15 AM
Per-packet IP DSCP/TOS Marking srikantap Programming 3 11-21-2011 06:12 AM
iptables packet marking and hfsc xanax Linux - Networking 0 02-18-2007 11:43 PM
iptables packet marking meks Linux - Networking 0 09-21-2004 05:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration