Страница 1 из 1

Роутинг к запасному модему

Добавлено: 2011-07-11 20:40:18
mediamag
Доброго времени суток всем. Никогда не приходилось сталкиваться с роутингом. Необходимо написать статический (постоянный) роут ко второму шлюзу (адсл модему с адресом yy.yy.yy.yy) для пинга адреса хх.хх.хх.хх

Re: Роутинг к запасному модему

Добавлено: 2011-07-11 20:55:56
terminus
31.2.5.2 Persistent Configuration

The above example is perfect for configuring a static route on a running system. However, one problem is that the routing information will not persist if you reboot your FreeBSD machine. The way to handle the addition of a static route is to put it in your /etc/rc.conf file:
# Add Internal Net 2 as a static route

Код: Выделить всё

static_routes="internalnet2"
route_internalnet2="-net 192.168.2.0/24 192.168.1.2"
The static_routes configuration variable is a list of strings separated by a space. Each string references to a route name. In our above example we only have one string in static_routes. This string is internalnet2. We then add a configuration variable called route_internalnet2 where we put all of the configuration parameters we would give to the route(8) command. For our example above we would have used the command:

Код: Выделить всё

# route add -net 192.168.2.0/24 192.168.1.2
so we need "-net 192.168.2.0/24 192.168.1.2".

As said above, we can have more than one string in static_routes. This allows us to create multiple static routes. The following lines shows an example of adding static routes for the 192.168.0.0/24 and 192.168.1.0/24 networks on an imaginary router:

Код: Выделить всё

static_routes="net1 net2"
route_net1="-net 192.168.0.0/24 192.168.0.1"
route_net2="-net 192.168.1.0/24 192.168.1.1"

Re: Роутинг к запасному модему

Добавлено: 2011-07-12 17:44:14
mediamag
Разобрался. Помогло. Спасибо.