W routerze mam karty sieciowe:
eth0: 192.168.1.1/24
eth1: 192.168.2.1/24
Jak napisać ip route add dla podsieci np 10.0.0.0/24, taki zapis jest niepoprawny
ip route add 10.0.0.0/24 gw 192.168.1.10 dev eth0
ip route add 10.0.0.0/24 gw 192.168.2.10 dev eth1
RTNETLINK answers: File exists
ip route add 10.0.0.0/24 gw 192.168.1.10 dev eth0 src 192.168.1.1
ip route add 10.0.0.0/24 gw 192.168.2.10 dev eth1 src 192.168.2.1
RTNETLINK answers: No such process
ip rule add from 192.168.1.0/24 table siec_1
ip rule add from 192.168.2.0/24 table siec_2
ip route flush cache
ip route add 10.0.0.0/24 via 192.168.1.10 dev eth1 table siec_1
ip route add 10.0.0.0/24 via 192.168.2.10 dev eth2 table siec_2
Sprawdzone działa.
Ale co Ty w ogóle chcesz osiągnąć i jak wygląda sieć?
Chcę osiągnąć to aby z siec_1 nie miała pojęcia o trasach w siec_2