Skip to contentSkip to conversation

IP Alias with iptables

DISCUSSION Alexis 2 participants 2 messages Apr 19, 2004 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 006901c4261e$01f081f0$0c00a8c0@pepelui

#1 lore raw
Quoted 8 lines

Enviado el: Lunes, 19 de Abril de 2004 08:53 a.m.

why not to use iproute2 adding a new ip address to the interface and filter
with the source?

Quoted 8 lines

like

ip add add 192.168.0.1/24 dev eth0
ip add add 192.168.1.1/24 dev eth0

and then apply the rules using the source address and not the interface???

could it help???

Could work, never tryed it, but how do i set it up to work on boot? i use RedHat 7.3 and have a /etc/sysconfig/network-scripts/ifcfg-eth0 file that has the next parameters:
DEVICE="eth0"
IPADDR="192.168.1.1"
NETMASK="255.255.255.0"
NETWORK=192.168.1.0
ONBOOT="yes"

Do i just simple add another IPADDR line?

Thanks

Rodrigo

Quoted 29 lines

----- Original Message -----
From: "Rodrigo Haces" <[email protected]>
To: <[email protected]>
Sent: Monday, April 19, 2004 12:41 PM
Subject: IP Alias with iptables

Quoted 3 lines

Hi:

I have only one network adapter in my Server, but i need to have 2

different

Quoted 1 line

networks, 192.168.1.0 to the MAC addresses i know and 192.168.0.0 to the

MAC

Quoted 1 line

addresses i dont't know, i have managed this by makin mi eth0 to

192.168.1.1

Quoted 2 lines

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

Quoted 9 lines

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

author
#2 lore raw

in my case, i prefer to use a script made by myself and call it by a rc.local or using a sysv script.

Im not shure if adding a new IPADDR will work, because you need iproute2 to achieve what i told you.

Just try and let us know :)

----- Original Message -----
From: "Rodrigo Haces" <[email protected]>
To: <[email protected]>
Sent: Monday, April 19, 2004 1:20 PM
Subject: RE: IP Alias with iptables

Quoted 8 lines
Quoted 8 lines

Enviado el: Lunes, 19 de Abril de 2004 08:53 a.m.

why not to use iproute2 adding a new ip address to the interface and filter
with the source?

Quoted 6 lines
Quoted 6 lines

like

ip add add 192.168.0.1/24 dev eth0
ip add add 192.168.1.1/24 dev eth0

and then apply the rules using the source address and not the

interface???

Quoted 12 lines
Quoted 2 lines

could it help???

Could work, never tryed it, but how do i set it up to work on boot? i use RedHat 7.3 and have a /etc/sysconfig/network-scripts/ifcfg-eth0 file that has the next parameters:
DEVICE="eth0"
IPADDR="192.168.1.1"
NETMASK="255.255.255.0"
NETWORK=192.168.1.0
ONBOOT="yes"

Quoted 20 lines

Do i just simple add another IPADDR line?

Thanks

Rodrigo

Quoted 14 lines

----- Original Message -----
From: "Rodrigo Haces" <[email protected]>
To: <[email protected]>
Sent: Monday, April 19, 2004 12:41 PM
Subject: IP Alias with iptables

Quoted 3 lines

Hi:

I have only one network adapter in my Server, but i need to have 2

different

Quoted 1 line

networks, 192.168.1.0 to the MAC addresses i know and 192.168.0.0 to

the

Quoted 4 lines
Quoted 4 lines

MAC

Quoted 1 line

addresses i dont't know, i have managed this by makin mi eth0 to

192.168.1.1

Quoted 1 line

and an alias eth0:0 to 192.168.0.1, everythings ok, but i'm also

sharing

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

internet, but when i start the rule to the eth0:0 it sends me

an error. Is

Quoted 1 line

there a way to use IP Aliasing with iptables? if not, is there a way

to

Quoted 11 lines
Quoted 8 lines
Quoted 8 lines

create an eth0 and eth1 witn the same adapter?

Thanks

Rodrigo