Липецкий государственный технический университет
Кафедра автоматизированных систем управления
Лабораторная работа №3
по дисциплине «Сетевые технологии»
«Настройка динамической маршрутизации на маршрутизаторах Linux»
|
Студент |
|
|
|
Фаустов А.С. |
|
||||||||
|
|
|
|
|
|
|
||||||||
|
Группа АИ-10 |
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
||||||||
|
Принял |
|
|
|
|
|
||||||||
|
|
|
|
|
Карантаев В.Г. |
|
||||||||
|
|
|
|
|
|
|
Липецк, 2014
-
Цель работы.
Изучить протоколы динамической маршрутизации в IP-сетях, получить практические навыки настройки программных маршрутизаторов на базе операционной системы Linux с применением маршрутизации пакетов динамической маршрутизации, реализующих протоколы RIP, OSPF.
-
Задание.
Настроить взаимодействие IP-сетей с использованием программных маршрутизаторов на ОС Linux и пакета Quagga, поддерживающего протоколы динамической маршрутизации RIP, OSPF. Настроить обмен маршрутной информацией по протоколам RIP и OSPF, проверить работоспособность сети.
Проверить настройку маршрутизации на примере взаимодействия рабочих станций, принадлежащих различным сетям, и взаимодействие рабочих станций с внешней сетью.
Рисунок 1. Принципиальная схема взаимодействия сетей для лабораторной работы
Схема ЛВС
При выполнении лабораторной работы задействуются 3 персональных компьютера, на каждом из которых развертывается по 2 виртуальных машины: первая – маршрутизатор, вторая – узел сети. В приведенных примерах схем ЛВС для лабораторной работы указана адресация для компьютеров PC151 (ПК-1), PC152 (ПК-2), PC153 (ПК-3) лаборатории. При использовании других компьютеров IP-адреса будут другими (см. приложение 1).
Рисунок 2. Физическая схема ЛВС для лабораторной работы
Рисунок 3. Логическая схема ЛВС для лабораторной работы
-
Схема установки.
Варианты адресов сетей для лабораторной работы
№ |
Сеть 1 |
Сеть 2 |
21 |
10.100.21.0/24 |
10.100.180.0/24 |
Рисунок 5. Схема ЛВС в среде GNS3
-
Конфигурационные файлы (для каждого маршрутизатора)
-
Маршрутизатор 1.
-
Содержание файла «etc/network/interfaces»
-
-
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# eth0
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.131.1
netmask 255.255.255.0
gateway 192.168.131.254
# eth1
auto eth1
allow-hotplug eth1
iface eth1 inet static
address 10.100.21.1
netmask 255.255.255.0
# eth2
auto eth2
allow-hotplug eth2
iface eth2 inet static
address 10.0.0.1
netmask 255.255.255.0
-
Содержание файла «etc/quagga/zebra.conf»
!host name
hostname serv1
!vty password
password zebra
!adminstrator password
enable password zebra
!log-file path
log file /var/log/quagga/zebra.log
-
Содержание файла «etc/quagga/ripd.conf»
!hostname
hostname serv1
!vty-password
password ripd
!administrator password
enable password ripd
!log-file path
log file /var/log/quagga/ripd.log
router rip
network eth1
network eth2
default-information originate
-
Содержание файла «etc/quagga/ospfd.conf»
!hostname
hostname serv1
!vty-password
password ospfd
!administrator password
enable password ospfd
!log-file path
log file /var/log/quagga/ospfd.log
router ospf
ospf router-id 10.100.21.1
network 10.100.21.0/24 area 0
network 10.0.0.0/24 area 1
default-information originate
-
Содержание файла «etc/rc.local»
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
iptables –t nat –A POSTROUTING –o eth0 –j MASQUERADE
exit 0
-
Маршрутизатор 2.
-
Содержание файла «etc/network/interfaces»
-
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# eth0
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 10.100.21.2
netmask 255.255.255.0
#gateway 10.100.21.1
# eth1
auto eth1
allow-hotplug eth1
iface eth1 inet static
address 10.100.180.1
netmask 255.255.255.0
# eth2
auto eth2
allow-hotplug eth2
iface eth2 inet static
address 10.0.1.1
netmask 255.255.255.0
-
Содержание файла «etc/quagga/zebra.conf»
!host name
hostname serv2
!vty password
password zebra
!adminstrator password
enable password zebra
!log-file path
log file /var/log/quagga/zebra.log
-
Содержание файла «etc/quagga/ripd.conf»
!hostname
hostname serv2
!vty-password
password ripd
!administrator password
enable password ripd
!log-file path
log file /var/log/quagga/ripd.log
router rip
network eth0
network eth1
network eth2
-
Содержание файла «etc/quagga/ospfd.conf»
!hostname
hostname serv2
!vty-password
password ospfd
!administrator password
enable password ospfd
!log-file path
log file /var/log/quagga/ospfd.log
router ospf
ospf router-id 10.100.21.2
network 10.100.21.0/24 area 0
network 10.100.180.0/24 area 0
network 10.0.1.0/24 area 2
-
Маршрутизатор 3.
-
Содержание файла «etc/network/interfaces»
-
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# eth0
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 10.100.180.2
netmask 255.255.255.0
#gateway 10.100.180.1
# eth1
auto eth1
allow-hotplug eth1
iface eth1 inet static
address 10.0.2.1
netmask 255.255.255.0
-
Содержание файла «etc/quagga/zebra.conf»
!host name
hostname serv3
!vty password
password zebra
!adminstrator password
enable password zebra
!log-file path
log file /var/log/quagga/zebra.log
-
Содержание файла «etc/quagga/ripd.conf»
!hostname
hostname serv3
!vty-password
password ripd
!administrator password
enable password ripd
!log-file path
log file /var/log/quagga/ripd.log
router rip
network eth0
network eth1
-
Содержание файла «etc/quagga/ospfd.conf»
!hostname
hostname serv3
!vty-password
password ospfd
!administrator password
enable password ospfd
!log-file path
log file /var/log/quagga/ospfd.log
router ospf
ospf router-id 10.100.180.2
network 10.100.180.0/24 area 0
network 10.0.2.0/24 area 3
-
Таблицы маршрутизации при работе протокола RIP (для каждого маршрутизатора)
-
Маршрутизатор 1.
-
До начала работы протокола RIP
-
-
-
После начала работы протокола RIP
-
Маршрутизатор 2.
-
До начала работы протокола RIP
-
-
После начала работы протокола RIP
-
Маршрутизатор 3.
-
До начала работы протокола RIP
-
-
После начала работы протокола RIP