静态路由实验

静态路由实验

静态路由实验_第1张图片
实验要求如图

1.首先进行ip地址规划(子网划分)

根据图上所示,大网段有5个用户网段和一个干路,可以划分为6个子网,即从192.168.1.0/24借3位,然后去其中一个为干路,划6个子网,其他为用户,根据图上要求,R1,R2,R4有2个环回,R3,R5有一个。所以可以划为:
192.168.1.0/27(干路)
192.168.1.0/30
192.168.1.4/30
192.168.1.8/30
192.168.1.12/30
192.168.1.16/30
192.168.1.20/30
192.168.1.32/27(R1)
192.168.1.32/28
192.168.1.48/28
192.168.1.64/27(R2)
192.168.1.64/28
192.168.1.80/28
192.168.1.96/27(R3)
192.168.1.128/27(R4)
192.168.1.128/28
192.168.1.144/28
192.168.1.160/27(R5)
R5和R6之间给一个网段56.1.1.1/24
R6是互联网给个202.1.1.1/24
如图:
静态路由实验_第2张图片

2.子网划分好了之后就是配地址了,先配环路再配接口。

配环回的命令是:
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 192.168.1.33 28
配接口的命令是:
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 30

3.用此方法配完所以的地址之后,我们可以先对R3进行DHCP:

[r3]dhcp enable
[r3]ip pool 1
[r3-ip-pool-1]network 192.168.1.96 mask 255.255.255.0
[r3-ip-pool-1]gateway-list 192.168.1.97
[r3-ip-pool-1]dns-list 1.2.3.1
[r3-ip-pool-1]quit
[r3]interface GigabitEthernet 0/0/2
[r3-GigabitEthernet0/0/2]dhcp select global
[r3-GigabitEthernet0/0/2]quit
配完DHCP后,进入pc启动DHCP服务,手动获取ip地址
如图:
静态路由实验_第3张图片

4.然后配缺省路由

[r1]ip route-static 0.0.0.0 0 192.168.1.2
[r1]ip route-static 0.0.0.0 0 192.168.1.14
[r2]ip route-static 0.0.0.0 0 192.168.1.6
[r3]ip route-static 0.0.0.0 0 192.168.1.10
[r4]ip route-static 0.0.0.0 0 192.168.1.18
[r5]ip route-static 0.0.0.0 0 56.1.1.3

5.下一跳

R1
[r1]ip route-static 192.168.1.64 27 192.168.1.2
[r1]ip route-static 192.168.1.4 30 192.168.1.2
[r1]ip route-static 192.168.1.96 27 192.168.1.14
[r1]ip route-static 192.168.1.8 30 192.168.1.14
R2
[r2]ip route-static 192.168.1.32 27 192.168.1.1
[r2]ip route-static 192.168.1.12 30 192.168.1.1
[r2]ip route-static 192.168.1.96 27 192.168.1.1
[r2]ip route-static 192.168.1.96 27 192.168.1.6
R3
[r3]ip route-static 192.168.1.32 27 192.168.1.13
[r3]ip route-static 192.168.1.0 30 192.168.1.13
[r3]ip route-static 192.168.1.64 27 192.168.1.13
[r3]ip route-static 192.168.1.64 27 192.168.1.10
R4
[r4]ip route-static 192.168.1.32 27 192.168.1.5
[r4]ip route-static 192.168.1.32 27 192.168.1.9
[r4]ip route-static 192.168.1.64 27 192.168.1.5
[r4]ip route-static 192.168.1.96 27 192.168.1.9
[r4]ip route-static 192.168.1.0 30 192.168.1.5
[r4]ip route-static 192.168.1.12 30 192.168.1.9
R5
[r5]ip route-static 192.168.1.32 27 192.168.1.17
[r5]ip route-static 192.168.1.64 27 192.168.1.17
[r5]ip route-static 192.168.1.96 27 192.168.1.17
[r5]ip route-static 192.168.1.128 27 192.168.1.17
[r5]ip route-static 192.168.1.0 30 192.168.1.17
[r5]ip route-static 192.168.1.12 30 192.168.1.17
[r5]ip route-static 192.168.1.4 30 192.168.1.17
[r5]ip route-static 192.168.1.8 30 192.168.1.17

6.备用100mb线路

改优先级,将备用线路的优先级改的大于现用线路
[r4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
[r5]ip route-static 192.168.1.32 27 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.64 27 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.96 27 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.128 27 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.0 30 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.12 30 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.4 30 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.8 30 192.168.1.21 preference 61

7.避免回路

[r1]ip route-static 192.168.1.32 27 NULL 0
[r2]ip route-static 192.168.1.64 27 NULL 0
[r4]ip route-static 192.168.1.128 27 NULL 0

8.NAT

[r5]acl 2000
[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r5-acl-basic-2000]quit
[r5]interface GigabitEthernet 0/0/1
[r5-GigabitEthernet0/0/1]nat outbound 2000
[r5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.33 23
Warning:The port 23 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:y
Info: The NAT in the network has existed.
Already existing configuration will be covered with current configure. [Y/N]:
y
[r1]aaa
[r1-aaa]local-user iu privilege level 15 password cipher redhat
Info: Add a new user.
[r1-aaa]local-user iu service-type telnet
[r1-aaa]quit
[r1]user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode aaa

你可能感兴趣的:(网络)