R: Configuring two networks with the same interface card
>On Wed, Jul 07, 1999 at 12:37:21PM +0400, Vadim Solonovich wrote:
>> Hi !
>>
>> I want to set up my Debian to work with two ip addresses on different
>> networks with one ethernet card.
>> Asuming two different physical networks 192.168.0.0 and 192.168.1.0 :
>>
>> # insmod ip_alias.o
>>
>> # ifconfig eth0 192.168.0.1 netmask 255.255.255.0
>> # ifconfig eth0:0 192.168.1.1 netmask 255.255.255.0
>>
>> # route add -net 192.168.0.0 dev eth0
>> # route add -net 192.168.1.0 dev eth0:0
ok
>> # route add -host 192.168.0.1 dev eth0
>> # route add -host 192.168.1.1 dev eth0:0
those are not necessary.
>>
>> Ping 192.168.0.10 is OK.
>>
>> # ping 192.168.1.10
>> ping : sendto: Operation not permitted
>> ping : wrote: 192.168.1.10 64 chars, ret = -1
>>
>> What's wrong ?
shutdown ipmasq on etc/init.d first of all
and issue
echo 1 > /proc/sys/net/ipv4/ip_forward
ipchains -A forward -j MASQ -s 192.168.0.0/24 -d 0.0.0.0/0
ipchains -A forward -j MASQ -s 192.168.1.0/24 -d 0.0.0.0/0
i've a similar situation at my work and it works fine. remember to setup on
each machine the default gateway 192.168.x.1
this might work fine for you.
Reply to: