实验需求:
PC-1/2 要 ping 通 PC-3 ;
实验步骤:
1.设备互联、IP地址规划、加电;
2.设备配置
内网设备
终端设备
PC1:
ip 192.168.10.1
mask 255.255.255.0
gateway 192.168.10.254
PC2:
ip 192.168.10.2
mask 255.255.255.0
gateway 192.168.10.254 网络设备
&2层设备-SW
@创建VLAN
br/>网络设备
&2层设备-SW
@创建VLAN
[SW]vlan 10
quit
[SW]port-group group-member gi0/0/1 to gi0/0/3
port link-type access
port default vlan 10
quit
3层设备-Router
[R1]interface gi0/0/2
[R1-GigabitEthernet0/0/2] ip address 192.168.10.254 255.255.255.0
[R1]interface gi0/0/0
[R1-GigabitEthernet0/0/0] ip address 12.1.1.1 255.255.255.0
[R1]ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
[R1]nat static global 12.1.1.3 inside 192.168.10.1
[R1]nat static global 12.1.1.4 inside 192.168.10.2
[R1]interface gi0/0/0
[R1-GigabitEthernet0/0/0]nat static enable
外网设备
[R2]interface gi0/0/1
[R2-GigabitEthernet0/0/1] ip address 12.1.1.2 255.255.255.0
[R2-GigabitEthernet0/0/1] interface gi0/0/0
[R2-GigabitEthernet0/0/0]ip address 13.1.1.254 255.255.255.0
PC3:
ip 13.1.1.253
mask 255.255.255.0
gateway 13.1.1.254
测试:
PC1:
192.168.10.1 --> 13.1.1.253
测试成功!!!!!
可以利用wireshark抓包验证
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。