配置要求:
1、按照拓扑图,自行搭建
2、配置相关的参数(各接口IP地址)
3、按照拓扑在SW1上配置VLAN信息,并设置为server模式,配置SW2为client模式并将端口11和12捆绑,起TRUNK
4、将PC划分到相应的VLAN中
5、在R1上划分子接口,并做DHCP让PC1~PC2自动获取到相应的IP地址
6、测试连通性
7、在R1上做NAT和ACL,让各PC可以ping通R2上的lo0口
----------------------------------R1---------------------------------------

en
conf t
no ip domain loo
line con 0
no exec-t
logg s
exit
ho R1
int lo0
ip add 100.1.1.1 255.255.255.0
int fa0/0
no shut
ip add 1.1.1.1 255.255.255.0
router eigrp 90
network 100.1.1.0 0.0.0.255
network 1.1.1.0 0.0.0.255
-------------------------------------R2------------------------------------

en
conf t
no ip domain loo
line con 0
no exec-t
logg s
exit
ho R2
int fa0/0
no shut
ip add 1.1.1.2 255.255.255.0

interface FastEthernet0/1.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
ip nat inside

interface FastEthernet0/1.30
encapsulation dot1Q 30
ip address 192.168.30.1 255.255.255.0
ip nat inside

ip dhcp pool vlan20
network 192.168.20.0 255.255.255.0
dns-server 210.29.144.1 210.29.144.2
default-router 192.168.20.1 192.168.20.10
ip dhcp excluded-address 192.168.20.1

ip dhcp pool vlan30 (pool name由用户指定)
network 192.168.30.0 255.255.255.0 (动态分配的地址段)
dns-server 210.29.144.1 210.29.144.2(为客户机配置dns服务器)
default-router 192.168.30.1(为客户机配置默认网关)
ip dhcp excluded-address 192.168.30.1

router eigrp 90
network 1.1.1.0 0.0.0.255
no auto-summary 

int fa0/0
ip nat outside(做外网端口)
access-list 1 permit 192.168.0.0 0.0.255.255(查看访问列表)
ip nat inside source list 1 interface f0/0 overload (地址的一对多复用)

------------------------------------SW1-------------------------------------

en
conf t
vlan 20
name chen
vlan 30
name he
exit
vtp domain chenhe
vtp mode server
vtp password cisco
int fa0/1
switchport trunk encapsulation dot1q
switchport mode trunk
intface port-channel 1
switchport trunk encapsulation dot1q
int range fa0/11 -12
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 1 mode on
int fa0/4
switchport mode access
sw ac vlan 20

 ----------------------------------SW2---------------------------------------

en
conf t
vtp domain chenhe
vtp mode client
vtp password cisco
intface port-channel 1
switchport trunk encapsulation dot1q
int range fa0/11 -12
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 1 mode on
int fa0/4
sw mo acc
sw acc vlan 30

 

 

欢迎访问:王磊的个人主页