Jump to content

Recommended Posts

Posted

Как передать статический маршрут клиенту под WinXP.

Кто то этим занимался? Никак не пойму синтаксис команды.

 

Кое что есть тут, но так и не получилось у меня передать маршрут.

http://wiki.luga.ru/wiki/Передача_static-r...s_по_cisco_dhcp

http://www.mikrotik.com/testdocs/ros/2.9/ip/dhcp.php

Posted

Средствами только одного микротика такое не реализовать. Как вариант, поставить юникс-бокс рядом и на нем по всем правилам поднять dhcpd с выдачей маршрутов, а на микротике настроить dhcp-relay.

  • 1 year later...
  • 1 month later...
Posted (edited)
Почему это не хочет передавать? Прекрасно всё передаёт.
и XP клиенты ее понимают?

Понимают. Передаём только opt249.

Ничего не понимаю. Ведь в перечне понимаемых opt249 в XP нет.

 

 

Все я разобрался..... Блин. я год с переменным успехом ковырял этот самый роутинг через DHCP... И тут пришло озарение! :)

Edited by rsst
Posted

А вот скриптик для генерации opt249 © в сети нашёл:

 

#!/usr/bin/perl

use strict;

sub make_classless_option
{
    my $routes = shift;
    my ($s1, $s2, $s3, $s4, $len, @bytes, $net, $mask, $destination, $router);

    $len = 2;
    @bytes = ();
    foreach $destination(keys %{$routes}) {
        ($net, $mask) = split('/', $destination);
        $router = $routes->{$destination};
        ($s1, $s2, $s3, $s4) = split(/\./, $net);
        push(@bytes, sprintf('%02x', $mask));
        push(@bytes, sprintf('%02x', $s1));
        push(@bytes, sprintf('%02x', $s2)) if($mask > 8);
        push(@bytes, sprintf('%02x', $s3)) if($mask > 16);
        push(@bytes, sprintf('%02x', $s4)) if($mask > 24);
        ($s1, $s2, $s3, $s4) = split(/\./, $router);
        push(@bytes, sprintf('%02x', $s1));
        push(@bytes, sprintf('%02x', $s2));
        push(@bytes, sprintf('%02x', $s3));
        push(@bytes, sprintf('%02x', $s4));
    }

    return join('', @bytes);
}

my $gateway = $ARGV[0];

print "0x";

print make_classless_option({
        "10.168.0.0/16" => $gateway,
        "10.1.2.0/24" => $gateway,
        "10.5.0.0/16" => $gateway
        });

print "\n";

 

Юзать: ./classless.pl 10.168.43.2

Выдаёт: 0x100aa80aa82b02100a050aa82b02180a01020aa82b02

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...
На сайте используются файлы cookie и сервисы аналитики для корректной работы форума и улучшения качества обслуживания. Продолжая использовать сайт, вы соглашаетесь с использованием файлов cookie и с Политикой конфиденциальности.