1 三层交换机配置摘要 1.1配置三层交换机的DHCP VLAN IP 端口成员
Vlan100 192.168.100.1/24 1~8 Vlan200 192.168.200.1/24 9~16 配置两个地址池:
PoolA (network 192.168.100.0) PoolB (network 192.168.200.0 ) 基本配置:switch(Config)# switch(Config)#vlan 100
switch(Config-Vlan100)#switchport interface ethernet 0/0/1-8 switch(Config-Vlan100)#exit switch(Config)#vlan 200
switch(Config-Vlan200)#switchport interface ethernet 0/0/9-16 switch(Config-Vlan200)#exit
switch(Config)#interface vlan 1
switch(Config-If-Vlan1)#ip address 192.168.1.1 255.255.255.0 switch(Config-If-Vlan1)#no shutdown switch(Config)#interface vlan 100
switch(Config-If-Vlan100)#ip address 192.168.100.1 255.255.255.0 switch(Config-If-Vlan100)#no shutdown switch(Config)#interface vlan 200
switch(Config-If-Vlan200)#ip address 192.168.200.1 255.255.255.0 switch(Config-If-Vlan200)#no shutdown
配置DHCP:switch(Config)#service dhcp !启用DHCP switch(Config)#ip dhcp pool testA !定义地址池
switch(dhcp-testA-config)#network-address 192.168.100.0 24 switch(dhcp-testA-config)#lease 3
switch(dhcp-testA-config)#default-router 192.168.100.1 switch(dhcp-testA-config)#dns-server 192.168.1.1 switch(dhcp-testA-config)#exit
switch(Config)#ip dhcp pool testB
switch(dhcp-testB-config)#network-address 192.168.200.0 24 switch(dhcp-testB-config)#lease 1
switch(dhcp-testB-config)#default-router 192.168.200.1 switch(dhcp-testB-config)#dns-server 192.168.1.1 switch(dhcp-testB-config)#exit 2 路由器配置摘要
2.1配置NAT
Router-A Router-B
F0/0 192.168.0.1/24 F0/0 192.168.2.1/24 S1/1 (DCE) 192.168.1.1/24 S1/0 192.168.1.2/24
Router-A#conf
Router-A_config#ip access-list standard 1 !定义访问控制列表
Router-A_config_std_nacl#permit 192.168.0.0 255.255.255.0 !定义允许转换的源地址范围
Router-A_config_std_nacl#exit
Router-A_config#ip nat pool overld 192.168.1.10 192.168.1.20 255.255.255.0 !定义名为overld 的转换地址池
Router-A_config#ip nat inside source list 1 pool overld overload
!配置将 ACL 允许的源地址转换成overld 中的地址,并且做PAT 的地址复用 Router-A_config#int f0/0
Router-A_config_f0/0#ip nat inside !定义F0/0 为内部接口 Router-A_config_f0/0#int s1/1
Router-A_config_s1/1#ip nat outside !定义S1/1 为外部接口 Router-A_config_s1/1#exit
Router-A_config#ip route 0.0.0.0 0.0.0.0 192.168.1.2 !配置路由器A 的缺省路由