From: Sven-Haegar Koch <haegar@sdinet.de>
To: koen.news@koca.be
Cc: netfilter@vger.kernel.org
Subject: Re: multiple external IP's - virtual NIC - DNAT problems
Date: Sat, 30 Jan 2010 14:22:16 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.00.1001301414410.16952@aurora.sdinet.de> (raw)
In-Reply-To: <62981.81.165.168.224.1264785772.squirrel@webmail.priorweb.be>
On Fri, 29 Jan 2010, koen.news@koca.be wrote:
> > The command you seek is "ip". Here's an example of adding an address to
> > an interface: "ip address add 1.2.3.4/8 dev eth4".
> >
> > Happy hacking!
> > Mike Wright
> >
> Thx for the reply. That's indeed what I seek!
>
> I guess I can put that command (or the debian variant) in the pre-up
> command for the interface?
Not pre-up, put them in up / post-up
You can also use eth0:1 eth0:2 interface definitions in debian
/etc/network/interfaces and use "-i eth0 -d $ip" in your firewall
config.
The eth0:X interfaces are not really network interfaces, they are just
secondary ip addresses on the base interface with a different label
attached to them for ifconfig backward compatibility.
Example:
ifconfig eth2:2 192.168.19.123 up
ip addr show dev eth2
-> inet 192.168.19.123/24 brd 192.168.19.255 scope global secondary eth2:2
ip addr add 192.168.19.124/24 dev eth2
ip addr show dev eth2
-> inet 192.168.19.123/24 brd 192.168.19.255 scope global secondary eth2:2
-> inet 192.168.19.124/24 scope global secondary eth2
c'ya
sven
--
Three may keep a secret, if two of them are dead.
- Ben F.
next prev parent reply other threads:[~2010-01-30 13:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-29 7:15 multiple external IP's - virtual NIC - DNAT problems koen.news
2010-01-29 14:46 ` Mike Wright
2010-01-29 17:22 ` koen.news
2010-01-29 18:36 ` Mike Wright
2010-01-30 13:22 ` Sven-Haegar Koch [this message]
2010-02-01 8:43 ` koen.news
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=alpine.DEB.2.00.1001301414410.16952@aurora.sdinet.de \
--to=haegar@sdinet.de \
--cc=koen.news@koca.be \
--cc=netfilter@vger.kernel.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