单臂路由配置+DHCP中继+OSPF实施
需求:将R1和R2分别分入vlan10 和vlan20, 并且两个vlan内的主机都使用DHCP动态地f分别从1.1.1.0和1.1.2.0网段获得IP地址,由R4作为DHCP服务器实现DHCP中继,并保留1.1.1.250-254和1.1.2.250-254
实施-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
R1:
R1<config># int e0/0
R1<config-if># ip address dhcp
R1<config-if># no shutdown
R2:
R2<config># int e0/0
R2<config-if># ip address dhcp
R2<config-if># no shutdown
SW1:
SW1<config># vlan 10,20
SW1<config># int e0/0
SW1<config-if># switchport mode access
SW1<config-if># switchport access vlan 10
SW1<config># int e0/1
SW1<config-if># switchport mode access
SW1<config-if># switchport access vlan 20
SW1<config-if># exit
SW1<config># int e0/2
SW1<config-if># switchport trunk encapsulation dot1q
SW1<config-if># switchport mode trunk
SW1<config-if># switchport trunk allowed vlan 10,20
R3:
R3<config># int e0/0
R3<config-if># no shutdown
R3<config-if># int e0/0.10
R3<config-subif># no shutdown
R3<config-subif># ip address 1.1.1.254 255.255.255.0
R3<config-subif># ip helper-address 192.168.1.1
R3<config-if># int e0/0.20
R3<config-subif># no shutdown
R3<config-subif># ip address 1.1.2.254 255.255.255.0
R3<config-subif># ip helper-addess 192.168.1.1
R3<config-if># int e0/1
R3<config-subif># no shutdown
R3<config-subif># ip address 192.168.1.2 255.255.255.0
R3<config-subif># exit
R3<config># router ospf 100
R3<config-router># router-id 0.0.0.1
R3<config-router># network 1.1.1.0 255.255.255.0
R3<config-router># network 1.1.2.0 255.255.255.0
R4:
R4<config># int e0/0
R4<config-if># ip address 192.168.1.1 255.255.255.0
R4<config-if># no shutdown
R4<config-if># exit
R4<config># ip dhcp excluded-address 1.1.1.250 1.1.1.254
R4<config># ip dhcp excluded-address 1.1.2.250 1.1.2.254
R4<config># ip dhcp pool vlan10
R4<dhcp-config># network 1.1.1.0 255.255.255.0
R4<dhcp-config># default-router 1.1.1.254 (255.255.255.0)
R4<dhcp-config># dns-server 114.114.114.114 8.8.8.8
R4<dhcp-config># domain-name wuguan.com
R4<config># ip dhcp pool vlan20
R4<dhcp-config># network 1.1.2.0 255.255.255.0
R4<dhcp-config># default-router 1.1.2.254 (255.255.255.0)
R4<dhcp-config># dns-server 114.114.114.114 8.8.8.8
R4<dhcp-config># domain-name wuguan.com
R4<dhcp-config># exit
R4<config># router ospf 100
R4<config-router># router-id 0.0.0.2
R4<config-router># network 192.168.1.1 255.255.255.0
配置结束---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------