From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Jeppe_S=F8rensen?= Subject: iptables with alias? Date: Sat, 5 Oct 2002 22:45:47 +0200 Sender: netfilter-admin@lists.netfilter.org Message-ID: <000a01c26cb0$309bdc80$1801a8c0@CBOOK> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: Content-Type: text/plain; charset="us-ascii" To: netfilter@lists.netfilter.org Hello I have a little question that perhaps someone can help me with I have a interface to the inet with 4 dynamic ip addr eth0 = first dynamic ip addr eth0:0 = second dynmaic ip addr and so on I want to make 1 on 1 nat on the frist 2 aliass and the last 2 alias are for the rest of the network 192.168.1.5 nat to eth0 192.168.1.6 nat to eth0:0 192.168.1.7-to-15 nat to eth0:1 192.168.1.16-to-30 nat to eth0:2 but iptables wan't take alias What do I do / what can I do ? I have looked in the The netfilter user mailinglist Archives and found the following solution ip addr add w.x.y.z/bits dev eth0 label eth00 but how does I get it to work with dynamic address? The archive mail I found the solution in http://lists.netfilter.org/pipermail/netfilter/2002-June/034592.html Jeppe Sorensen Denmark From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Jeppe_S=F8rensen?= Subject: iptables with alias? Date: Sat, 5 Oct 2002 22:37:33 +0200 Sender: netfilter-admin@lists.netfilter.org Message-ID: <002301c26caf$0a063210$1801a8c0@CBOOK> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0020_01C26CBF.CC236420" Return-path: Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: To: netfilter@lists.netfilter.org This is a multi-part message in MIME format. ------=_NextPart_000_0020_01C26CBF.CC236420 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello I have a little question that perhaps someone can help me with I have a interface to the inet with 4 dynamic ip addr eth0 =3D first dynamic ip addr eth0:0 =3D second dynmaic ip addr and so on I want to make 1 on 1 nat on the frist 2 aliass and the last 2 alias are = for the rest of the network 192.168.1.5 nat to eth0 192.168.1.6 nat to eth0:0 192.168.1.7-to-15 nat to eth0:1 192.168.1.16-to-30 nat to eth0:2 but iptables wan't take alias What do I do / what can I do ? I have looked in the The netfilter user mailinglist Archives and found = the following solution ip addr add w.x.y.z/bits dev eth0 label eth00 but how does I get it to work with dynamic address? The archive mail I found the solution in http://lists.netfilter.org/pipermail/netfilter/2002-June/034592.html Jeppe Sorensen Denmark ------=_NextPart_000_0020_01C26CBF.CC236420 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello
I have a little question that perhaps = someone can=20 help me with
 
I have a interface to the = inet with 4 dynamic=20 ip addr
eth0 =3D first dynamic ip = addr
eth0:0 =3D second dynmaic ip = addr
and so on
 
I want to make 1 on 1 nat on the = frist 2=20 aliass and the last 2 alias are for the rest of the network
192.168.1.5 nat to eth0
192.168.1.6 nat to eth0:0
192.168.1.7-to-15 nat to = eth0:1
192.168.1.16-to-30 nat to = eth0:2
 
but iptables wan't take = alias
 
What do I do / what can I do = ?
 
I have looked in the The=20 netfilter user mailinglist Archives and found the = following=20 solution
 
ip addr add w.x.y.z/bits dev eth0 label = eth00
 
but how does I get it to work with = dynamic=20 address?
 
 
The archive mail I found = the solution=20 in
http://lists.netfilter.org/pipermail/netfilter/2002-June/034592.html=
 
 
Jeppe Sorensen
Denmark
------=_NextPart_000_0020_01C26CBF.CC236420-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Antony Stone Subject: Re: iptables with alias? Date: Sat, 5 Oct 2002 21:53:13 +0100 Sender: netfilter-admin@lists.netfilter.org Message-ID: <20021005205315.FLSK7631.mta03-svc.ntlworld.com@there> References: <002301c26caf$0a063210$1801a8c0@CBOOK> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <002301c26caf$0a063210$1801a8c0@CBOOK> Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: Content-Type: text/plain; charset="iso-8859-1" To: netfilter@lists.netfilter.org On Saturday 05 October 2002 9:37 pm, Jeppe S=F8rensen wrote: > Hello > > I have a little question that perhaps someone can help me with > > I have a interface to the inet with 4 dynamic ip addr > eth0 =3D first dynamic ip addr > eth0:0 =3D second dynmaic ip addr > and so on > > I want to make 1 on 1 nat on the frist 2 aliass and the last 2 alias are > for the rest of the network 192.168.1.5 nat to eth0 > 192.168.1.6 nat to eth0:0 > 192.168.1.7-to-15 nat to eth0:1 > 192.168.1.16-to-30 nat to eth0:2 You're right - netfilter doesn't accept : characters in interface names. I suggest you create a script to (re)write appropriate SNAT rules, which is= =20 called by dhcpcd, or whatever else you use to acquire your dynamic=20 addresses... Antony. --=20 The difference between theory and practice is that in theory there is no difference, whereas in practice there is. From mboxrd@z Thu Jan 1 00:00:00 1970 From: leolistas@solucoesip.net Subject: Re: iptables with alias? Date: Sat, 5 Oct 2002 17:59:23 -0300 Sender: netfilter-admin@lists.netfilter.org Message-ID: <1033851563.3d9f52ab0fa9d@webmail.solucoesip.net> References: <000a01c26cb0$309bdc80$1801a8c0@CBOOK> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <000a01c26cb0$309bdc80$1801a8c0@CBOOK> Content-Disposition: inline Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: Content-Type: text/plain; charset="iso-8859-1" To: Jeppe =?ISO-8859-1?B?U/hyZW5zZW4=?= Cc: "netfilter@lists.netfilter.org" I think you'll have to tweak your firewall scripts and build your own=20 customized SNAT rules. I mean ..... your firewall script can easily get=20 the IP address of the interface ( even alias one ) with something similar=20 to: ifconfig "eth0 " | grep inet | cut -d":" -f 2 | cut -d" " -f 1 Then, in POSTROUTING you could build your rules, just like: iptables -t nat -A POSTROUTING -s 192.168.1.5 -j SNAT --to-source $IP_ETH0 iptables -t nat -A POSTROUTING -s 192.168.1.6 -j SNAT --to-source=20 $IP_ETH00 iptables -t nat -A POSTROUTING -s 192.168.1.8/29 -j SNAT --to-source=20 $IP_ETH01 ( 192.168.1.8/29 matches 7-15 ) ... and go on .... Note that this script can be only executed after ALL interfaces get=20 their IP addresses .... Hope this helps, Leonardo Rodrigues Quoting Jeppe S=F8rensen : > Hello >=20 > I have a little question that perhaps someone can help me with >=20 > I have a interface to the inet with 4 dynamic ip addr > eth0 =3D first dynamic ip addr > eth0:0 =3D second dynmaic ip addr > and so on >=20 > I want to make 1 on 1 nat on the frist 2 aliass and the last 2 alias are > for > the rest of the network > 192.168.1.5 nat to eth0 > 192.168.1.6 nat to eth0:0 > 192.168.1.7-to-15 nat to eth0:1 > 192.168.1.16-to-30 nat to eth0:2 >=20 > but iptables wan't take alias >=20 > What do I do / what can I do ? >=20 > I have looked in the The netfilter user mailinglist Archives and found > the > following solution >=20 > ip addr add w.x.y.z/bits dev eth0 label eth00 >=20 > but how does I get it to work with dynamic address? From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stewart Thompson Subject: RE: iptables with alias? Date: Sat, 05 Oct 2002 14:52:12 -0700 Sender: netfilter-admin@lists.netfilter.org Message-ID: References: <20021005205315.FLSK7631.mta03-svc.ntlworld.com@there> Reply-To: stewart.thompson@shaw.ca Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-reply-to: <20021005205315.FLSK7631.mta03-svc.ntlworld.com@there> Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: Content-Type: text/plain; charset="iso-8859-1" To: Antony Stone , netfilter@lists.netfilter.org Hi Antony: =09This just a test. My posts don't seem to be showing up on the list= . Regards, Stu........ -----Original Message----- =46rom: netfilter-admin@lists.netfilter.org [mailto:netfilter-admin@lists.netfilter.org]On Behalf Of Antony Stone Sent: October 5, 2002 1:53 PM To: netfilter@lists.netfilter.org Subject: Re: iptables with alias? On Saturday 05 October 2002 9:37 pm, Jeppe S=F8rensen wrote: > Hello > > I have a little question that perhaps someone can help me with > > I have a interface to the inet with 4 dynamic ip addr > eth0 =3D first dynamic ip addr > eth0:0 =3D second dynmaic ip addr > and so on > > I want to make 1 on 1 nat on the frist 2 aliass and the last 2 alia= s are > for the rest of the network 192.168.1.5 nat to eth0 > 192.168.1.6 nat to eth0:0 > 192.168.1.7-to-15 nat to eth0:1 > 192.168.1.16-to-30 nat to eth0:2 You're right - netfilter doesn't accept : characters in interface nam= es. I suggest you create a script to (re)write appropriate SNAT rules, wh= ich is called by dhcpcd, or whatever else you use to acquire your dynamic addresses... Antony. -- The difference between theory and practice is that in theory there is no difference, whereas in practice there is.