old_z
15-02-2008, 01:11
Есть router mandriva 2008
eth0 192.168.5.2 -> adsl modem
eth1 192.168.0.1 -> Локалка
eth2 192.168.2.3 -> (шлюз 192.168.2.1) -> (сеть 192.168.1.0/24)
ppp0 -> Интернет
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
xxx.xxx.xxx.xxx * 255.255.255.255 UH 0 0 0 ppp0
192.168.5.0 * 255.255.255.0 U 10 0 0 eth0
192.168.2.0 * 255.255.255.0 U 10 0 0 eth2
192.168.0.0 * 255.255.255.0 U 10 0 0 eth1
default * 0.0.0.0 U 0 0 0 ppp0
Нужно прописать маршрут в сеть 192.168.1.0/24
Пишу вручную
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.2.1
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
xxx.xxx.xxx.xxx * 255.255.255.255 UH 0 0 0 ppp0
192.168.5.0 * 255.255.255.0 U 10 0 0 eth0
192.168.2.0 * 255.255.255.0 U 10 0 0 eth2
192.168.1.0 192.168.2.1 255.255.255.0 UG 0 0 0 eth2
192.168.0.0 * 255.255.255.0 U 10 0 0 eth1
default * 0.0.0.0 U 0 0 0 ppp0
Добавляю в /etc/sysconfig/static-routes
any net 192.168.1.0 netmask 255.255.255.0 gw 192.168.2.1
# /etc/init.d/network restart
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
xxx.xxx.xxx.xxx * 255.255.255.255 UH 0 0 0 ppp0
192.168.5.0 * 255.255.255.0 U 10 0 0 eth0
192.168.2.0 * 255.255.255.0 U 10 0 0 eth2
192.168.1.0 192.168.2.1 255.255.255.0 UG 0 0 0 ppp0
192.168.0.0 * 255.255.255.0 U 10 0 0 eth1
default * 0.0.0.0 U 0 0 0 ppp0
пишу вручную
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.2.1 eth2
все нормально
правлю /etc/sysconfig/static-routes
any net 192.168.1.0 netmask 255.255.255.0 gw 192.168.2.1 eth2
# /etc/init.d/network restart
SIOCADDRT: Нет такого процесса
eth0 192.168.5.2 -> adsl modem
eth1 192.168.0.1 -> Локалка
eth2 192.168.2.3 -> (шлюз 192.168.2.1) -> (сеть 192.168.1.0/24)
ppp0 -> Интернет
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
xxx.xxx.xxx.xxx * 255.255.255.255 UH 0 0 0 ppp0
192.168.5.0 * 255.255.255.0 U 10 0 0 eth0
192.168.2.0 * 255.255.255.0 U 10 0 0 eth2
192.168.0.0 * 255.255.255.0 U 10 0 0 eth1
default * 0.0.0.0 U 0 0 0 ppp0
Нужно прописать маршрут в сеть 192.168.1.0/24
Пишу вручную
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.2.1
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
xxx.xxx.xxx.xxx * 255.255.255.255 UH 0 0 0 ppp0
192.168.5.0 * 255.255.255.0 U 10 0 0 eth0
192.168.2.0 * 255.255.255.0 U 10 0 0 eth2
192.168.1.0 192.168.2.1 255.255.255.0 UG 0 0 0 eth2
192.168.0.0 * 255.255.255.0 U 10 0 0 eth1
default * 0.0.0.0 U 0 0 0 ppp0
Добавляю в /etc/sysconfig/static-routes
any net 192.168.1.0 netmask 255.255.255.0 gw 192.168.2.1
# /etc/init.d/network restart
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
xxx.xxx.xxx.xxx * 255.255.255.255 UH 0 0 0 ppp0
192.168.5.0 * 255.255.255.0 U 10 0 0 eth0
192.168.2.0 * 255.255.255.0 U 10 0 0 eth2
192.168.1.0 192.168.2.1 255.255.255.0 UG 0 0 0 ppp0
192.168.0.0 * 255.255.255.0 U 10 0 0 eth1
default * 0.0.0.0 U 0 0 0 ppp0
пишу вручную
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.2.1 eth2
все нормально
правлю /etc/sysconfig/static-routes
any net 192.168.1.0 netmask 255.255.255.0 gw 192.168.2.1 eth2
# /etc/init.d/network restart
SIOCADDRT: Нет такого процесса