Portál AbcLinuxu, 25. dubna 2024 10:58
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
ale potreboval bych tam pridat jeste nejake takoveto pravidlo
192.168.2.0 192.168.1.120 255.255.255.0 UG 0 0 0 eth0
aby se vsechny pakety do podsite 192.168.2.* posilaly prez pocitac 192.168.1.120
Da se to nejak nastavit na DHCP serveru bezicim na 192.168.1.1? Jak?
Dekuju za postrceni.
ip r add 192.168.2.0/24 via 192.168.1.120 dev eth0
jinak:
route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.1.120
option new-static-routes code 249 = string;
A do konfigurace pro subnet potom:
option new-static-routes 18:c0:a8:02:c0:a8:01:78;
Otestoval jsem to s MS Windows XP a fungovalo to. Ten hexa řetězec je vypočítaný pro 192.168.2.0/24 via 192.168.1.120.
option static-routes destination_IP router_IP;
option static-routes 192.168.2.0 192.168.1.120;
man dhcp-options
a vypadlo mně následující:
option new-static-routes code 201 = array of { ip-address, ip-address, ip-address, integer 8 }; option static-routes 10.0.0.0 255.255.255.0 net-0-rtr.example.com 1, 10.0.1.0 255.255.255.0 net-1-rtr.example.com 1, 10.2.0.0 255.255.224.0 net-2-0-rtr.example.com 3;
Tiskni Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.