eNSP综合实验:OSPF、DHCP、NAT等技术运用

拓扑图

1、 SW1为PC1和PC2的DHCP服务器,AR2为PC3和PC4的DHCP服务器

2、PC1、PC2、PC3、PC4能够访问外网

3、外网能够访问内网的HTTP服务器和FTP服务器

SW1配置

system-view 
sysname SW1

vlan batch 10 20 50 101

//各vlanif的IP地址配置如下:
[SW1]display ip interface brief 

Interface                         IP Address/Mask      Physical   Protocol  
LoopBack0                         44.44.44.44/32       up         up(s)     
Vlanif10                          192.168.10.254/24    up         up        
Vlanif20                          192.168.20.254/24    up         up        
Vlanif50                          192.168.50.254/24    up         up        
Vlanif101                         192.168.101.1/30     up         up    

//各端口配置
[SW1]interface GigabitEthernet0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 101

[SW1]interface GigabitEthernet0/0/2
[SW1-GigabitEthernet0/0/2]port hybrid pvid vlan 10
[SW1-GigabitEthernet0/0/2]port hybrid untagged vlan 10

[SW1]interface GigabitEthernet0/0/3
[SW1-GigabitEthernet0/0/3]port hybrid pvid vlan 20
[SW1-GigabitEthernet0/0/3]port hybrid untagged vlan 20

[SW1]interface GigabitEthernet0/0/23
[SW1-GigabitEthernet0/0/23]port link-type access
[SW1-GigabitEthernet0/0/23]port default vlan 50

[SW1]interface GigabitEthernet0/0/24
[SW1-GigabitEthernet0/0/24]port link-type access
[SW1-GigabitEthernet0/0/24]port default vlan 50

//DHCP配置
[SW1]dhcp enable

[SW1]ip pool vlanif10
[SW1-ip-pool-vlanif10]gateway-list 192.168.10.254
[SW1-ip-pool-vlanif10]network 192.168.10.0 mask 24
[SW1-ip-pool-vlanif10]lease day 2
[SW1-ip-pool-vlanif10]dns-list 114.114.114.114

[SW1]interface Vlanif10
[SW1-Vlanif10]ip address 192.168.10.254 24
[SW1-Vlanif10]dhcp select global        //基于全局DHCP

[SW1]interface Vlanif20
[SW1-Vlanif20]ip address 192.168.20.254 24
[SW1-Vlanif20]dhcp select interface     //基于接口DHCP
[SW1-Vlanif20]dhcp server lease day 2
[SW1-Vlanif20]dhcp server dns-list 114.114.114.114

//OSPF配置
[SW1]router id 44.44.44.44
[SW1]ospf 1
[SW2-ospf-1]area 1
[SW2-ospf-1-area-0.0.0.1]network 192.168.101.1 0.0.0.0
[SW2-ospf-1-area-0.0.0.1]network 192.168.10.0 0.0.0.255
[SW2-ospf-1-area-0.0.0.1]network 192.168.20.0 0.0.0.255
[SW2-ospf-1-area-0.0.0.1]network 192.168.50.0 0.0.0.255

SW2配置

[SW2]vlan batch 30 40 102

//各vlanif的IP地址配置如下:
[SW2]display ip interface brief 

Interface                         IP Address/Mask      Physical   Protocol  
LoopBack0                         55.55.55.55/32       up         up(s) 
Vlanif30                          192.168.30.254/24    up         up       
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值