Linux Netfilter discussions
 help / color / mirror / Atom feed
From: WA Support <support@wildapache.net>
To: netfilter@lists.netfilter.org
Subject: Re: Using an device alias?
Date: Tue, 07 Jan 2003 10:23:17 -0700	[thread overview]
Message-ID: <3E1B0D05.34338FF5@wildapache.net> (raw)
In-Reply-To: b74ecb8788.b8788b74ec@cvip.net

Steve,

The virtual interface is dealt with in the kernel, iptables doesn't care
about it, iptables just knows about the IP.

I have many virtual interfaces in rc.local, each associated with a
specific IP address.  All iptables cares about is the IP address.

What I have is this (I use a sript as opposed to
/etc/sysconfig/ipchains).

(snip)

LAN_IP="192.168.1.5"
LAN_IP_RANGE="192.168.1.0/24"
LAN_BCAST_ADRESS="192.168.1.255"
LAN_IFACE="eth0"

...

#########################################################################################
#
# Rules for INPUT chain for virtual interfaces
#

$IPTABLES -A INPUT -p ALL -i $INET_IFACE -s $LAN_IP_RANGE -d
$LAN_IP_RANGE -j ACCEPT
$IPTABLES -A INPUT -p ALL -i $LO_IFACE -s $LAN_IP_RANGE -d $LAN_IP_RANGE
-j ACCEPT


#
# Rules for OUTPUT chain for virtual interfaces
#

$IPTABLES -A OUTPUT -p ALL -s $LAN_IP_RANGE -j ACCEPT

#
#########################################################################################

# 
# Rules for special networks not part of the Internet
#
...

$IPTABLES -A INPUT -p ALL -i $LAN_IFACE -s $LAN_IP_RANGE -j ACCEPT

...

(snip)

Hope this is what you were after, it works fine for me!

Murrah Boswell


Steve M Bibayoff wrote:
> 
> Sorry if everyone gets this twice, this one is a
> second posting when I realized this was a closed list.
> 
> Original question:
> Is it possible to use iptables with a device alias
> (ex.. eth0:1)? I tries to add a filter rule and got
> an error:
> % iptables -t filter -I INPUT -i eth0:1 -j ACCEPT
> Warning: wierd character in interface `eth0:1' (No
> aliases, :, ! or *).
> 
> If i list the rules, it's listed, but it doesn't
> appear to be working. I was wondering if someone had
> a definite answer.
> 
> TIA
> 
> Steve


  parent reply	other threads:[~2003-01-07 17:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-03 19:28 Using an device alias? Steve M Bibayoff
2003-01-04  3:33 ` Joel Newkirk
     [not found]   ` <3E19CD4E.2050700@csufresno.edu>
     [not found]     ` <3E19DD6B.7070503@csufresno.edu>
2003-01-06 19:56       ` Steve
2003-01-06 21:41         ` Joel Newkirk
2003-01-06  5:30 ` Raymond Leach
2003-01-07 17:23 ` WA Support [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-01-03 19:07 Steve M Bibayoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E1B0D05.34338FF5@wildapache.net \
    --to=support@wildapache.net \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox