I have two physical networks:
eth0 192.168.0.0/24 with with several PCs and NAT adresss 192.168.0.1 where PPPoE connecting to inet;
eth1 192.168.0.1/24 with several PCs and no internet.
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.2
gateway 192.168.0.1
netmask 255.255.255.0
auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
up route add -net 192.168.0.0/24 gw 192.168.0.1 dev eth0
up route add -net 192.168.1.0/24 gw 192.168.1.2 dev eth1
and got:
Reconfiguring network interfaces...RTNETLINK answers: File exists
Failed to bring up eth1.
what route I should add and why eth1 failed? What default gateway I should add for 192.168.1.0/24 network? Can anywone help?
But I don't need internet in 192.168.1.0/24. Also PCs in 1.0/24 should not see PCs in 0.0/24.
When I tried to configure network without routes I can't ping anything in 192.168.1.0/24. That's why I think about route add.
– Alexander B Feb 13 '16 at 18:32Chain INPUT (policy ACCEPT) target prot opt source destination
Chain FORWARD (policy ACCEPT) target prot opt source destination ACCEPT all -- 192.168.1.0/24 192.168.0.0/24 ACCEPT all -- 192.168.0.0/24 192.168.1.0/24
Chain OUTPUT (policy ACCEPT) target prot opt source destination
– Alexander B Feb 13 '16 at 20:45iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; iptables -I FORWARD -i eth0 -o eth1 -j ACCEPT
May or may not work, this is where I start to zone out! :) – Sir_Scofferoff Feb 13 '16 at 23:28PS: Sorry, it was my IP mistakes. After your instructions ICMP request to 192.168.1.200 (NAS) are going from localhost. I have also changed network mask on PC 192.168.0.5 to 255.255.0.0 and tried to send ICMP to IP adress of eth1 (192.168.1.2). Yeah, they returned from eth1!
Now looking for good advices with MASQUERADE. Can anyone help?
– Alexander B Feb 14 '16 at 02:23