0

thanks in advance

I have 2 networks and one debian gateway

network 1 (eth0) 192.168.1.4 network 2 (eth1) 10.20.10.4

if I want ping from 10.... to 192.... do I need to add both gateways to the pcs ? like 192.168.1.4 and 10.20.10.4. If I put then like that the ping occur with no problems, if I put only 10.20.10.4 has gateway, there is no ping. from 10 to 192

0

You can have many interfaces on a system. Each one can have an IP on a diffferent subnet. There's a default gateway where all traffic go to. You'll need to add static route for other subnets.

For example.

eth0 192.168.1.2/24 eth1 10.0.0.2/24 eth2 10.1.0.2/24 default gw: 192.168.1.1

If there's no other routes, all outgoing traffics will go to 192.168.1.1, even those for 10.x.x.x.

There should be gw for other subnet also, hopefully. You should have static routes such as

route add -net 10.0.0.0/24 gw 10.0.0.1 dev eth1

route add -net 10.1.0.0/24 gw 10.0.0.1 dev eth2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.