IPTables question


 
Thread Tools Search this Thread
Special Forums IP Networking IPTables question
# 1  
Old 02-20-2011
IPTables question

Hope someone can help cus m really stuck.
Im pretty good at making basic IPTables rules to get what i need done, but this one has me beat.

I have only 1 Nic in my linux box , and its setup as a trunk to my switch.
I have 5 vlans setup on it:

eth0.1000
eth0.1001
eth0.1002
eth0.1003
eth0.1004

I can get it to route between the vlans without trouble using a simple
-A INPUT -i eth0.1000 -j ALLOW
-A INPUT -i eth0.1001 -j ALLOW
-A INPUT -i eth0.1002 -j ALLOW
......ect
With forward, input and output set to accept.

Now if I ssh to any machine on any Vlan it routes between them perfectly.

PROBLEM IS:

Reversing the accept to drop and lock down the routes to just allow SSH.
If tried things like -A FORWARD -i eth0.1000 -o eth0.1001 ect and I cant get it to allow ssh from and to my separate vlans.

Can anyone help, all i want is a basic iptables to allow ssh from any machine on any vlan to any machine on any vlan, but block everything else.

Thanks for ANY advice.

Steve
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Multi-table iptables Question

I have a question regarding IPTables packet flow, that I am hoping I can get an answer to. We have a fairly advanced implementation of IPTables that I am trying to convert into a third party product and I am not quite certain on the packet flow in the current IPTables implementation. We are... (2 Replies)
Discussion started by: knightfirefx
2 Replies

2. IP Networking

iptables question

I have two programs, a datagram socket based sender and a datagram socket based receiver. The sender emits a short UDP message to 192.168.0.100:33333 every second. The receiver creates a datagram socket with a default port number (let's say it is 44444), clears the iptables adds the following rule:... (4 Replies)
Discussion started by: michaelrusse
4 Replies

3. Cybersecurity

iptables question.

I am setting up a new squid daemon to run on my server. I want to make sure that everyone inside my network can access squid but I want to make sure everyone on the internet is blocked. eth0 is connected to my internal LAN via: 192.168.0.5/255.255.255.0 eth1 is connected to the internet via:... (1 Reply)
Discussion started by: nondescriptciti
1 Replies

4. UNIX for Dummies Questions & Answers

help with iptables

Hi, On the IPTABLES, I did iptables --flush. I want to start fresh. Now I only want two things. Allow one ip address to this server. Allow port 443 as incoming from every where. Please advice how to do this. This is what I did so for. iptables -I INPUT -i eth0 -s 1.2.3.4 -j ACCEPT... (5 Replies)
Discussion started by: samnyc
5 Replies

5. IP Networking

Iptables

What should be the iptables rule so that only the subnet 64.61.11.224/255.255.255.248 may access the mysql port 3306 (1 Reply)
Discussion started by: proactiveaditya
1 Replies

6. IP Networking

Need help with iptables

Trying to create a whitelist to limit bandwidth. My sync speed is 1536/256 kbps. Simple rules in order: 1. Do not limit (or set to 1536/256) MAC 00:00:00:00:00 (computer is in 192.168.1.0/24). 2. Do not limit (or set to 1536/256) MAC 00:00:00:00:01 (computer is in 192.168.1.0/24). 3. Do not... (1 Reply)
Discussion started by: kripz
1 Replies

7. Linux

iptables question need help

Description i used iptables firewall is a month,running is favorable.it is failed when i connecting to my server on time.the servers' web service and all ports did not connect.i remote login the other server and through intranet address login this server then i restart iptables .but through... (0 Replies)
Discussion started by: proceed
0 Replies

8. IP Networking

IPtables

Hey guys, I have just started using IP tables and was wondering if anyone could direct me to any good online resources as I am totally new to this. Thanks. (1 Reply)
Discussion started by: 182x
1 Replies
Login or Register to Ask a Question
Apache2::SiteControl(3pm)				User Contributed Perl Documentation				 Apache2::SiteControl(3pm)

NAME
Apache2::SiteControl - Perl web site authentication/authorization system SYNOPSIS
See samples/site for complete example. Note, this module is intended for mod_perl. See Apache2::SiteControl for mod_perl2. DESCRIPTION
Apache2::SiteControl is a set of perl object-oriented classes that implement a fine-grained security control system for a web-based application. The intent is to provide a clear, easy-to-integrate system that does not require the policies to be written into your application components. It attempts to separate the concerns of how to show and manipulate data from the concerns of who is allowed to view and manipulate data and why. For example, say your web application is written in HTML::Mason. Your individual "screens" are composed of Mason modules, and you would like to keep those as clean as possible, but decisions have to be made about what to allow as the component is processed. SiteControl attempts to make that as easy as possible. DEVELOPER'S VIEWPOINT - EXAMPLE In this document we use HTML::Mason to create examples of how to use the control mechanisms, but any mod_perl based system should be supportable. A good mason component tries to do most of the perl processing in a separate block, so that simple substitutions can be made in HTML in the rest of the page. This makes it much easier for web developers and perl developers to co-exist on a project. The SiteControl system tries to make it possible to continue to follow this model. You obtain a user object and permission manager from the SiteControl system. These are intended to be opaque data types to the page designer, and are defined elsewhere (see USERS). The actual web page component should carry these objects around without implementing anything in the way of policy. For example, your mason component might look like this: <HTML> <HEAD> ... </HEAD> % if($manager->can($currentUser, "edit", $table)) { <FORM METHOD=POST ACTION="..."> <P><INPUT TYPE=TEXT NAME="x" VALUE="<% $table->{x} %>"> ... </FORM> % } else { <P>x is <% $table->{x} %> % } <%init> my $currentUser = Apache2::SiteControl->getCurrentUser($r); my $manager = Apache2::SiteControl->getPermissionManager($r); ... application specific stuff... i.e. my $table = ... </%init> Notice that the component does not bother looking at the user object, and there is no policy code...just a request for permission: if($manager->can($currentUser, "do something to", $resource)) Of course the developer needs to know something about the underlying system. For example, the action string "do something to" is rather arbitrary. These can be anything, and must be specified as rule actions. It is recommended that you use some form of Perl constants for these instead of strings, but that is up to you. The resource is intended to be less opaque. This is likely the object that the page developer wants to muck with, and so probably knows the internals of that object a bit better. This is the crossover point from what SiteControl can figure out on its own to information you have to supply. The default behavior is for the manager to deny any request. In order for a request to be approved, someone has to write a rule that joins together the user, action, and resource and makes a decision about the permissibility of the action. If all you want is login and user tracking (but no permission manager), then it is safe to ignore the permission manager altogether. USERS
Users and Rules are the central components of the SiteControl system. The user object must be Apache2::SiteControl::User (or a subclass). See Apache2::SiteControl::User for a description of what it supports (session storage, logout, etc.). The glue to SiteControl is the UserFactory, which you can define or accept the default of Apache2::SiteControl::UserFactory (recommended). Whenever a login attempt succeeds, the factory returns an object that represents a valid, logged-in user. See Apache2::SiteControl::UserFactory for more information. PERMISSION MANAGER Each site will have a permission manager. There is usually no need for you to subclass Apache2::SiteControl::PermissionManager, but you do need to create one and populate it with your access rules. You do this by creating a factory class, which looks something like this: package samples::site::MyPermissionFactory; use Apache2::SiteControl::PermissionManager; use Apache2::SiteControl::GrantAllRule; use samples::site::EditControlRule; use base qw(Apache2::SiteControl::ManagerFactory); our $manager; sub getPermissionManager { return $manager if defined($manager); $manager = new Apache2::SiteControl::PermissionManager; $manager->addRule(new Apache2::SiteControl::GrantAllRule); $manager->addRule(new samples::site::EditControlRule); return $manager; } 1; The primary goal of your factory is to produce an instance of a permission manager that knows the rules for permitting access to your site. This is an easy process that involves calling the constructor (via new) and then calling addRule one or more times. RULES The PermissionManager is the object that the site developers ask about what is allowed and what is not. As you saw in the previous section, you create a manager, and add some rules. Each rule is a custom-written class that implements some aspect of your site's access logic. Rules can choose to grant or deny a request. The following is a pretty complex example that demonstrates the features of a rule. Most rules with either specifically grant permission, or deny it. Most will not deal with both possibilities. In this example we are assuming that the user is implemented as an object that has attributes which can be retrieved with a getAttribute method (of course, you would have to have implemented that as well). The basic action that this rule handles is called "beat up", so the site makes calls like: if($referee->can($userA, "beat up", $userB)) { ... } In terms of English, we would describe the rule "If A is taller than B, then we say that A can beat up B. If A is less skilled than B, then we say that A cannot beat up B". The rule looks like this: package samples::FightRules; use strict; use warnings; use Carp; use Apache2::SiteControl::Rule; use base qw(Apache2::SiteControl::Rule); sub grants($$$$) { my $this = shift; my $user = shift; my $action = shift; my $resource = shift; if($action eq "beat up" && $resource->isa("Apache2::SiteControl::User")) { my ($h1, $h2); $h1 = $user->getAttribute("height"); $h2 = $resource->getAttribute("height"); return 1 if(defined($h1) && defined($h2) && $h1 > $h2); } return 0; } sub denies($$$$) { my $this = shift; my $user = shift; my $action = shift; my $resource = shift; if($action eq "beat up" && $resource->isa("Apache2::SiteControl::User")) { my ($s1, $s2); $s1 = $user->getAttribute("skill"); $s2 = $resource->getAttribute("skill"); return 1 if(defined($s1) && defined($s2) && $s1 < $s2); } return 0; } 1; The PermissionManager will only give permission if at least one rule grants permission, and no rule denies it. I think it is clearer to separate rules like the previous one into separate rule classes altogether. A HeightMakesMightRule and a DefenseSkillRule. Splitting into two rules makes things clearer, and there is no limit to the number of rules that the PermissionManager can check. It is important that your rules never grant or deny a request they do not understand, so it is a good idea to use type checking to prevent strangeness. Assertions should not be used if you expect different rules to accept different resource types or user types, since each rule is used on every access request. EXPORT
None by default. SEE ALSO
Apache2::SiteControl::UserFactory, Apache::SiteControl::ManagerFactory, Apache2::SiteControl::PermissionManager, Apache::SiteControl::Rule AUTHOR
This module was written by Tony Kay, <tkay@uoregon.edu>. COPYRIGHT AND LICENSE
This modules is covered by the GNU public license. perl v5.14.2 2006-08-16 Apache2::SiteControl(3pm)