jackzmeng 发表于 2008-11-19 16:54:51

[原创]Cisco三层交换机与Routeros OSPF+DHCP服务器配置实例

本案例使用Cisco三层交换机结合Mikrotik Routeros配置OSPF动态路由及多Vlan Dhcp服务器中继配置。
   使用设备如下
   三层交换机:Cisco 3550 EMI
   接入层交换机:HUAWEI Quidway S2008
   Mikrotik RouterOs 3.13
   网络拓扑如下:

http://125.71.5.45/img/top.jpg

   
   配置目的:验证Routeros OSPF动态路由及DHCP中继
   配置文档:
   CISCO 3550

ip routing
#开启路由功能#
ip dhcp excluded-address 10.100.0.100
#设置dhcp服务器ip地址#
interface FastEthernet0/2
switchport trunk encapsulation dot1q
switchport mode trunk
#设置与2层交换机互联的trunk端口#
interface FastEthernet0/23
switchport access vlan 2
switchport mode access
spanning-tree portfast
#设置与ros连接的端口的vlan#

interface Vlan2
description server
ip address 10.100.0.1 255.255.255.0
#设置3层交换机vlan接口ip#
!
interface Vlan3
description office
ip address 10.100.3.1 255.255.255.0
ip helper-address 10.100.0.100
!
#设置3层交换机vlan接口ip及配置dhcp中继#
interface Vlan4
description sales
ip address 10.100.4.1 255.255.255.0
ip helper-address 10.100.0.100
!
#设置3层交换机vlan接口ip及配置dhcp中继#
interface Vlan5
description users
ip address 10.100.5.1 255.255.255.0
ip helper-address 10.100.0.100
!
#设置3层交换机vlan接口ip及配置dhcp中继#
router ospf 10
router-id 10.100.0.1
log-adjacency-changes
network 10.100.0.0 0.0.255.255 area 10.100.0.0
#配置ospf进程及area信息#

HUAWEI Quidway S2008 配置:
interface Ethernet0/6
switchport access vlan 5
!
#配置用户端口#
interface Ethernet0/7
switchport access vlan 3
!
#配置用户端口#
interface Ethernet0/8
switchport access vlan 4
#配置用户端口#
interface Ethernet0/9
switchport mode trunk
switchport trunk allowed vlan all
!
#设置与3层交换机互联的trunk端口#


Mikrotik Routeros:

/ip pool
add name="vlan3" ranges=10.100.3.2-10.100.3.254
add name="vlan4" ranges=10.100.4.2-10.100.4.254
add name="vlan5" ranges=10.100.5.2-10.100.5.254
#设置不同Vlan的地址池#
/ip dhcp-server
add address-pool=vlan3 authoritative=after-2sec-delay bootp-support=static \
    disabled=no interface=in lease-time=3d name="vlan3" relay=10.100.3.1
add address-pool=vlan4 authoritative=after-2sec-delay bootp-support=static \
    disabled=no interface=in lease-time=3d name="vlan4" relay=10.100.4.1
add address-pool=vlan5 authoritative=after-2sec-delay bootp-support=static \
    disabled=no interface=in lease-time=3d name="vlan5" relay=10.100.5.1
#设置Dhcp-server 使之支持Dhcp中继#
/routing ospf area
add area-id=0.0.0.0 authentication=none disabled=no name="backbone" \
    type=default
add area-id=10.100.0.0 authentication=none disabled=no name="area1" \
    type=default
#配置ospf area#
/ip address
add address=10.100.0.100/24 broadcast=10.100.0.255 comment="" disabled=no \
    interface=in network=10.100.0.0
#配置内部IP地址#

/ip dns
set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB \
    max-udp-packet-size=512 primary-dns=192.168.100.208 \
#配置dns#

/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no \
    src-address=10.100.0.0/16
#配置NAT#

/routing ospf
set distribute-default=always-as-type-2 metric-bgp=20 metric-connected=20 \
    metric-default=1 metric-rip=20 metric-static=20 mpls-te-area=unspecified \
    mpls-te-router-id=unspecified redistribute-bgp=no \
    redistribute-connected=no redistribute-rip=no redistribute-static=no \
    router-id=10.100.100.2
/routing ospf interface
add authentication=none authentication-key="" cost=10 dead-interval=40s \
    disabled=no hello-interval=10s interface=in network-type=broadcast \
    passive=no priority=1 retransmit-interval=5s transmit-delay=1s
/routing ospf network
add area=area1 disabled=no network=10.100.0.0/16

#配置OSPF路由协议#

jackzmeng 发表于 2008-11-19 17:06:05

cisco3550#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 10.100.0.100 to network 0.0.0.0

   10.0.0.0/24 is subnetted, 4 subnets
C       10.100.4.0 is directly connected, Vlan4
C       10.100.5.0 is directly connected, Vlan5
C       10.100.3.0 is directly connected, Vlan3
C       10.100.0.0 is directly connected, Vlan2
O*E2 0.0.0.0/0 via 10.100.0.100, 01:09:52, Vlan2

jackzmeng 发表于 2008-11-19 17:06:36

/ip route> print
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
#      DST-ADDRESS      PREF-SRC      GATEWAY-STATE GATEWAY                                          DISTANCE INTERFACE                              
0 ADS0.0.0.0/0                        reachable   192.168.18.1                                     0      out                                    
1 ADC10.100.0.0/24      10.100.0.100                                                                   0      in                                       
2 ADo10.100.3.0/24                      reachable   10.100.0.1                                       110      in                                       
3 ADo10.100.4.0/24                      reachable   10.100.0.1                                       110      in                                       
4 ADo10.100.5.0/24                      reachable   10.100.0.1                                       110      in                                       
5 ADC192.168.18.0/24    192.168.18.158                                                               0      out

zhjchina 发表于 2008-11-19 21:21:39

好文章,顶

jackzmeng 发表于 2008-11-19 23:05:11

经测试
不同vlan的客户机能获得指定网段ip地址


华为设备三层设备的相关验证实验将在近期发布

zhjchina 发表于 2008-11-19 23:08:58

这里网吧人士太多了,以后应该多讨论讨论企业级应用

jackzmeng 发表于 2008-11-19 23:11:00

网吧应用也是Ros应用的一个方面

网络-浪子 发表于 2008-11-19 23:19:13

做个标记,慢慢,看.

jackzmeng 发表于 2008-11-20 11:45:28

怎么没什么人回帖啊?

看不懂?

小狼 发表于 2008-11-20 13:07:39

是应该,来点像样的文章了。

小狼 发表于 2008-11-20 13:08:10

人工置顶

breach 发表于 2008-11-21 22:27:36

多谢楼主好文章

cqjdxyy 发表于 2008-11-23 11:39:11

好强大的阵容!

banchen 发表于 2008-11-26 17:26:17

好,谢谢,回去做下实验!

throwwf 发表于 2008-11-28 22:13:25

很好,我来到一个好地方!
页: [1] 2 3 4 5 6 7 8
查看完整版本: [原创]Cisco三层交换机与Routeros OSPF+DHCP服务器配置实例