Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Michael Gale <michael.gale@utilitran.com>
To: netfilter@lists.netfilter.org
Subject: Re: IP Alias with iptables
Date: Mon, 19 Apr 2004 09:22:31 -0600	[thread overview]
Message-ID: <20040419092231.24a53ddc@mgalepc.utilitran.com> (raw)
In-Reply-To: <EMEKLOMJOPNJPAFKHEDJGECGCDAA.rhaces_chistes@yahoo.com.mx>

Hello,

	eth0:0 is an alias to eth0 -- so in iptables you must reference the interface
(eth0) and they also go by destination (-d) 

So in the following example:
eth0 = 192.168.0.1
eth0:0 = 10.10.0.1

iptables -A INPUT -i eth0 -d 192.168.0.1 -p tcp --dport 80 -j ACCEPT

will allow port 80 for the 192.168.0.1 network and

iptables -A INPUT -i eth0 -d 10.10.0.1 -p tcp --dport 25 -j ACCEPT 

will allow mail for the 10.10.0.1 network.

Michael.


On Mon, 19 Apr 2004 09:41:44 -0600
"Rodrigo Haces" <rhaces_chistes@yahoo.com.mx> wrote:

> Hi:
> 
> I have only one network adapter in my Server, but i need to have 2 different
> networks, 192.168.1.0 to the MAC addresses i know and 192.168.0.0 to the MAC
> addresses i dont't know, i have managed this by makin mi eth0 to 192.168.1.1
> and an alias eth0:0 to 192.168.0.1, everythings ok, but i'm also sharing
> internet, but when i start the rule to the eth0:0 it sends me an error. Is
> there a way to use IP Aliasing with iptables? if not, is there a way to
> create an eth0 and eth1 witn the same adapter?
> 
> Thanks
> 
> Rodrigo
> 
> 
> 
> 
> 
> 


-- 
Michael Gale
Network Administrator
Utilitran Corporation


  parent reply	other threads:[~2004-04-19 15:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-19 15:41 IP Alias with iptables Rodrigo Haces
2004-04-19 14:53 ` Antony Stone
2004-04-19 16:07   ` Rodrigo Haces
2004-04-19 15:25     ` Antony Stone
2004-04-19 16:12       ` Alistair Tonner
2004-04-19 21:31         ` Antony Stone
2004-04-20  3:08           ` Rodrigo Haces
2004-04-20  7:33             ` Antony Stone
2004-04-20 23:39               ` Rodrigo Haces
2004-04-21  7:50                 ` Antony Stone
2004-04-20 18:06           ` Dick St.Peters
2004-04-20 18:27             ` Antony Stone
2004-04-19 16:55       ` Rodrigo Haces
2004-04-19 15:43     ` Cedric Blancher
2004-04-19 15:22 ` Michael Gale [this message]
     [not found] <006901c4261e$01f081f0$0c00a8c0@pepelui>
2004-04-19 16:20 ` Rodrigo Haces
2004-04-19 15:28   ` Alexis

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=20040419092231.24a53ddc@mgalepc.utilitran.com \
    --to=michael.gale@utilitran.com \
    --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