[SOLVED] exclude users from access to ethernet port

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

[SOLVED] exclude users from access to ethernet port

Postby magfan » Aug 6th, '12, 12:05

My system has several ethernet ports (eth0 .. eth5) and I want to exclude several users from access to one specific port (eth1). How can I do this?
Last edited by magfan on Feb 13th, '14, 15:35, edited 1 time in total.
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: exclude users from access to ethernet port

Postby doktor5000 » Aug 7th, '12, 20:45

How do you want to exclude users? From logging in via a specific interface, or from using it from the inside?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: exclude users from access to ethernet port

Postby magfan » Aug 8th, '12, 08:29

doktor5000 wrote:How do you want to exclude users? From logging in via a specific interface, or from using it from the inside?

From inside.
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: exclude users from access to ethernet port

Postby ah7013 » Aug 8th, '12, 14:18

Is shorewall enabled on eth1? If so, you could just modify /etc/shorewall/rules and append some rules to block the specific users. For example adding:
Code: Select all
REJECT $FW net:eth1 - - - - - user1
REJECT $FW net:eth1 - - - - - user2
REJECT $FW net:eth1 - - - - - user3
REJECT $FW net:eth1 - - - - - user4

to that file would reject any outgoing packets from user1, user2, user3 and user4 on eth1. Once you have modified the file just restart shorewall (systemctl restart shorewall.service)
Mageia 2 x86_64, KDE 4.8.5 on a Thinkpad Edge E520 - Intel Core i7-2640M 2.8GHZ, 16GB DDR3 RAM 1333MHz
Mageia 2 x86_64, KDE 4.8.5 on a Dell Studio 1555 - Intel Core 2 Duo T6600 2.2GHz, 8GB DDR2 RAM 800MHz
User avatar
ah7013
 
Posts: 74
Joined: Apr 9th, '11, 05:02
Location: Adelaide, Australia

Re: exclude users from access to ethernet port

Postby magfan » Aug 22nd, '12, 08:12

ah7013 wrote:Is shorewall enabled on eth1? If so, you could just modify /etc/shorewall/rules and append some rules to block the specific users. For example adding:
Code: Select all
REJECT $FW net:eth1 - - - - - user1
REJECT $FW net:eth1 - - - - - user2
REJECT $FW net:eth1 - - - - - user3
REJECT $FW net:eth1 - - - - - user4

to that file would reject any outgoing packets from user1, user2, user3 and user4 on eth1. Once you have modified the file just restart shorewall (systemctl restart shorewall.service)

I tried it but after editing the rules I discovered problems for other users on other eth* ports. Maybe because this line was the only one in /etc/shorewall/rules and shorewall has some default settings for other (not explicitly listed) eth* ports. Do I have to configure shorewall for all eth* ports separately?
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: exclude users from access to ethernet port

Postby ah7013 » Aug 23rd, '12, 03:36

No you shouldn't need to configure all eth* ports seperatly. I did try it on one of my computers with only configuring that one eth* port and it worked fine :-/. Although you could try configuring them seperately by adding something like this to the same rules file:
Code: Select all
ACCEPT $FW net:eth0
ACCEPT $FW net:eth2
ACCEPT $FW net:eth3
ACCEPT $FW net:eth4
ACCEPT $FW net:eth5

which should allow all outgoing packets from those interfaces from any user but I am not sure if it would work.
Mageia 2 x86_64, KDE 4.8.5 on a Thinkpad Edge E520 - Intel Core i7-2640M 2.8GHZ, 16GB DDR3 RAM 1333MHz
Mageia 2 x86_64, KDE 4.8.5 on a Dell Studio 1555 - Intel Core 2 Duo T6600 2.2GHz, 8GB DDR2 RAM 800MHz
User avatar
ah7013
 
Posts: 74
Joined: Apr 9th, '11, 05:02
Location: Adelaide, Australia


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest