交换机当内部网关,负责内部流量的转发,路由器负责外部流量
拓撲圖
適合內部流量較大的小網絡。
1、配置路由器基礎部分
The device is running!
system-view #進入系統視圖
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR #修改設備名稱
[AR]interface GigabitEthernet 0/0/0 #進入接口0/0/0
[AR-GigabitEthernet0/0/0]ip address 10.11.12.13 24 #配置IP地址及子網掩碼
[AR-GigabitEthernet0/0/0]ping 10.11.12.1 #檢測連通性
PING 10.11.12.1: 56 data bytes, press CTRL_C to break
Reply from 10.11.12.1: bytes=56 Sequence=1 ttl=128 time=80 ms
Reply from 10.11.12.1: bytes=56 Sequence=2 ttl=128 time=10 ms
Reply from 10.11.12.1: bytes=56 Sequence=3 ttl=128 time=10 ms
Reply from 10.11.12.1: bytes=56 Sequence=4 ttl=128 time=10 ms
Reply from 10.11.12.1: bytes=56 Sequence=5 ttl=128 time=10 ms
--- 10.11.12.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/24/80 ms
[AR-GigabitEthernet0/0/0]quit #退出端口
[AR]interface GigabitEthernet 0/0/1 #進入端口0/0/1
[AR-GigabitEthernet0/0/1]ip address 192.168.1.253 24 #配置IP地址及子網掩碼
[AR-GigabitEthernet0/0/1]quit #退出端口
2、配置交換機
The device is running!
system-view #進入系統視圖
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname Switch #修改設備名稱
[Switch]interface Vlanif 1 #進入vlanif 1接口(三層接口)
[Switch-Vlanif1]ip address 192.168.1.254 24 #配置IP地址及子網掩碼
[Switch-Vlanif1]ping 192.168.1.253 #檢測連通性
PING 192.168.1.253: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.253: bytes=56 Sequence=1 ttl=255 time=70 ms
Reply from 192.168.1.253: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 192.168.1.253: bytes=56 Sequence=3 ttl=255 time=40 ms
Reply from 192.168.1.253: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 192.168.1.253: bytes=56 Sequence=5 ttl=255 time=40 ms
--- 192.168.1.253 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/46/70 ms
[Switch-Vlanif1]quit #退出vlanif接口
[Switch]ip route-static 0.0.0.0 0.0.0.0 192.168.1.253 #配置默認路由
3、路由器nat部分
[AR]dns server 114.114.114.114 #配置dns服務器地址
[AR]dns resolve #開啟dns功能
[AR]acl 2001 #創建acl 2001
[AR-acl-basic-2001]rule permit source 192.168.1.0 0.0.0.255 #匹配允許的ip地址及長度
[AR-acl-basic-2001]quit #退出acl 2001
[AR]interface GigabitEthernet 0/0/0 #進入端口0/0/0
[AR-GigabitEthernet0/0/0]nat outbound 2001 #配置nat方向及匹配規則
[AR]ip route-static 0.0.0.0 0.0.0.0 10.11.12.1 #添加默認路由
4、PC檢測是否可以訪問網關及外網
查看PC地址及ping交換機網關
PC地址及ping網關
可以ping外網網關及baidu地址
#謝謝#
#華為##路由器#
總結
以上是生活随笔為你收集整理的交换机当内部网关,负责内部流量的转发,路由器负责外部流量的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 王者荣耀网名女英文148个
- 下一篇: 王者荣耀破甲弓在哪里