1 实验拓扑图
2 配置命令
1)s1配置:
enable
vlan database
vlan 10 name 10
vlan 20 name 20
exit
congfigure terminal
hostname s1
interface range fastethernet 0/1 – 3
switchport trunk encapsulation dot1q
no shutdown
exit
interface fastethernet 0/2
switchport access vlan 10
exit
interface fastethernet 0/3
switchport access vlan 20
exit
interface fastethernet 0/3
switchport mode trunk
2)s2配置:
enable
vlan database
vlan 10 name 10
vlan 20 name 20
exit
configure terminal
hostname s2
interface fastethernet 0/1
switchport mode trunk
no shutdown
exit
interface fastethernet 0/2
no switchport
ip address 192.168.3.1 255.255.255.0
no shutdown
exit
ip routing
interface vlan 10
ip address 192.168.1.1 255.255.255.0
no shutdown
exit
interface vlan 20
ip address 192.168.2.1 255.255.255.0
no shutdown
exit
router rip
network 192.168.1.0
network 192.168.2.0
network 192.168.3.0
version 2
3)r1配置:
enable
configure terminal
hostname r1
interface fastethernet 0/0
ip address 192.168.3.2 255.255.255.0
no shutdown
exit
interface fastethernet 1/0
ip address 192.168.4.1 255.255.255.0
no shutdown
exit
router rip
network 192.168.3.0
network 192.168.4.0
version 2
4)配置DHCP中继转发
interface vlan vlan 号
ip helper-address dhcpserver-address
3:查看配置
1) 查看路由表
show ip route
2)查看FIB表
show ip cef
3)查看邻接关系表
0