交换机基础配置

交换机基础配置

这里写图片描述
这里写图片描述
这里写图片描述
这里写图片描述

//1.基本配置
PC>ping 10.1.1.2

Ping 10.1.1.2: 32 data bytes, Press Ctrl_C to break
From 10.1.1.2: bytes=32 seq=1 ttl=128 time=78 ms
From 10.1.1.2: bytes=32 seq=2 ttl=128 time=109 ms
From 10.1.1.2: bytes=32 seq=3 ttl=128 time=78 ms
From 10.1.1.2: bytes=32 seq=4 ttl=128 time=78 ms
From 10.1.1.2: bytes=32 seq=5 ttl=128 time=78 ms

--- 10.1.1.2 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 78/84/109 ms
//现在PC1和PC2能够正常通信

这里写图片描述

[S1]int g0/0/1
[S1]undo negotiation auto
[S1-GigabitEthernet0/0/1]duplex full
[S2]interface g0/0/2
[S2-GigabitEthernet0/0/2]undo negotiation auto  
[S2-GigabitEthernet0/0/2]duplex full 
[S3]interface g0/0/1
[S3-GigabitEthernet0/0/1]undo negotiation auto 
[S3-GigabitEthernet0/0/1]duplex full
[S3]interface g0/0/2
[S3-GigabitEthernet0/0/2]undo negotiation auto 
[S3-GigabitEthernet0/0/2]duplex full

这里写图片描述

[S1]int e0/0/1
[S1-Ethernet0/0/1]undo negotiation auto 
[S1-Ethernet0/0/1]speed 10

用同样的方法配置另外两台设备接口的速率

[S2]int e0/0/1  
[S2-Ethernet0/0/1]undo negotiation auto     
[S2-Ethernet0/0/1]speed 10
[S2-Ethernet0/0/1]quit
[S2]int g0/0/2
[S2-GigabitEthernet0/0/2]undo negotiation auto 
[S2-GigabitEthernet0/0/2]speed 100
[S3]int g0/0/1  
[S3-GigabitEthernet0/0/1]undo negotiation auto 
[S3-GigabitEthernet0/0/1]speed 100
[S3-GigabitEthernet0/0/1]int g0/0/2
[S3-GigabitEthernet0/0/2]undo negotiation auto 
[S3-GigabitEthernet0/0/2]speed 100

理解ARP及Proxy ARP

这里写图片描述
这里写图片描述
这里写图片描述
这里写图片描述

实验拓扑

这里写图片描述
这里写图片描述
这里写图片描述

[Huawei]sysname R1
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 10.1.1.254 255.255.255.0
[R1-GigabitEthernet0/0/1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip address 10.1.2.254 255.255.255.0
[R1-GigabitEthernet0/0/2]display arp all
IP ADDRESS      MAC ADDRESS     EXPIRE(M) TYPE        INTERFACE   VPN-INSTANCE 
                                          VLAN/CEVLAN PVC                      
------------------------------------------------------------------------------
10.1.1.254      00e0-fca4-403f            I -         GE0/0/1
10.1.2.254      00e0-fca4-4040            I -         GE0/0/2
------------------------------------------------------------------------------
Total:2         Dynamic:0       Static:0     Interface:2    

这里写图片描述

PC>ping 10.1.1.254

Ping 10.1.1.254: 32 data bytes, Press Ctrl_C to break
From 10.1.1.254: bytes=32 seq=1 ttl=255 time=78 ms
From 10.1.1.254: bytes=32 seq=2 ttl=255 time=31 ms
From 10.1.1.254: bytes=32 seq=3 ttl=255 time=31 ms
From 10.1.1.254: bytes=32 seq=4 ttl=255 time=32 ms
From 10.1.1.254: bytes=32 seq=5 ttl=255 time=31 ms

--- 10.1.1.254 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/40/78 ms

PC>ping 10.1.1.2

Ping 10.1.1.2: 32 data bytes, Press Ctrl_C to break
From 10.1.1.2: bytes=32 seq=1 ttl=128 time=32 ms
From 10.1.1.2: bytes=32 seq=2 ttl=128 time=47 ms
From 10.1.1.2: bytes=32 seq=3 ttl=128 time=31 ms
From 10.1.1.2: bytes=32 seq=4 ttl=128 time=31 ms
From 10.1.1.2: bytes=32 seq=5 ttl=128 time=32 ms

--- 10.1.1.2 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/34/47 ms

这里写图片描述

PC>ping 10.1.2.254

Ping 10.1.2.254: 32 data bytes, Press Ctrl_C to break
From 10.1.2.254: bytes=32 seq=1 ttl=255 time=46 ms
From 10.1.2.254: bytes=32 seq=2 ttl=255 time=31 ms
From 10.1.2.254: bytes=32 seq=3 ttl=255 time=31 ms
From 10.1.2.254: bytes=32 seq=4 ttl=255 time=31 ms
From 10.1.2.254: bytes=32 seq=5 ttl=255 time=47 ms

--- 10.1.2.254 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/37/47 ms

这里写图片描述
这里写图片描述
这里写图片描述

PC>arp -a

Internet Address    Physical Address    Type
10.1.1.254          00-E0-FC-A4-40-3F   dynamic
[R1]display arp all
IP ADDRESS      MAC ADDRESS     EXPIRE(M) TYPE        INTERFACE   VPN-INSTANCE 
                                          VLAN/CEVLAN PVC                      
------------------------------------------------------------------------------
10.1.1.254      00e0-fca4-403f            I -         GE0/0/1
10.1.1.1        5489-98bf-4d8e  18        D-0         GE0/0/1
10.1.2.254      00e0-fca4-4040            I -         GE0/0/2
10.1.2.3        5489-989a-5d98  20        D-0         GE0/0/2
------------------------------------------------------------------------------
Total:4         Dynamic:2       Static:0     Interface:2  

这里写图片描述
这里写图片描述

[R1]arp static 10.1.1.1 5489-98bf-4d7e
[R1]display arp all 
IP ADDRESS      MAC ADDRESS     EXPIRE(M) TYPE        INTERFACE   VPN-INSTANCE 
                                          VLAN/CEVLAN PVC                      
------------------------------------------------------------------------------
10.1.1.254      00e0-fca4-403f            I -         GE0/0/1
10.1.2.254      00e0-fca4-4040            I -         GE0/0/2
10.1.2.3        5489-989a-5d98  12        D-0         GE0/0/2
10.1.1.1        5489-98bf-4d7e            S--
------------------------------------------------------------------------------
Total:4         Dynamic:1       Static:1     Interface:2  

[R1]ping 10.1.1.1
  PING 10.1.1.1: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

  --- 10.1.1.1 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss
PC>ping 10.1.1.254

Ping 10.1.1.254: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 10.1.1.254 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

这里写图片描述

[R1]undo arp static 10.1.1.1 5489-98bf-4d7e
[R1]arp static 10.1.1.1 5489-98bf-4d8e
[R1]arp static 10.1.1.2 5489-9863-3fba
[R1]arp static 10.1.2.3 5489-989A-5d98
[R1]display arp all
IP ADDRESS      MAC ADDRESS     EXPIRE(M) TYPE        INTERFACE   VPN-INSTANCE 
                                          VLAN/CEVLAN PVC                      
------------------------------------------------------------------------------
10.1.1.254      00e0-fca4-403f            I -         GE0/0/1
10.1.2.254      00e0-fca4-4040            I -         GE0/0/2
10.1.1.1        5489-98bf-4d8e            S--
10.1.1.2        5489-9863-3fba            S--
10.1.2.3        5489-989a-5d98            S--
------------------------------------------------------------------------------
Total:5         Dynamic:0       Static:3     Interface:2    

配置完成后,在PC-1上测试

PC>ping 10.1.1.254

Ping 10.1.1.254: 32 data bytes, Press Ctrl_C to break
From 10.1.1.254: bytes=32 seq=1 ttl=255 time=47 ms
From 10.1.1.254: bytes=32 seq=2 ttl=255 time=47 ms
From 10.1.1.254: bytes=32 seq=3 ttl=255 time=31 ms
From 10.1.1.254: bytes=32 seq=4 ttl=255 time=31 ms
From 10.1.1.254: bytes=32 seq=5 ttl=255 time=47 ms

--- 10.1.1.254 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/40/47 ms

这里写图片描述
这里写图片描述
这里写图片描述

[R1]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 10       Routes : 10       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       10.1.1.0/24  Direct  0    0           D   10.1.1.254      GigabitEthernet
0/0/1
     10.1.1.254/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
     10.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
       10.1.2.0/24  Direct  0    0           D   10.1.2.254      GigabitEthernet
0/0/2
     10.1.2.254/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.1.2.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

这里写图片描述

PC>ping 10.1.2.3

Ping 10.1.2.3: 32 data bytes, Press Ctrl_C to break
From 10.1.1.2: Destination host unreachable
From 10.1.1.2: Destination host unreachable
From 10.1.1.2: Destination host unreachable
From 10.1.1.2: Destination host unreachable
From 10.1.1.2: Destination host unreachable

--- 10.1.2.3 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

这里写图片描述
这里写图片描述

[R1]int g0/0/1  
[R1-GigabitEthernet0/0/1]arp-proxy enable

这里写图片描述
这里写图片描述
这里写图片描述

PC>arp -a

Internet Address    Physical Address    Type
10.1.2.3            00-E0-FC-A4-40-3F   dynamic

这里写图片描述

[R1]int g0/0/2  
[R1-GigabitEthernet0/0/2]arp-proxy enable 
PC>ping 10.1.1.1

Ping 10.1.1.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 10.1.1.1: bytes=32 seq=2 ttl=127 time=78 ms
From 10.1.1.1: bytes=32 seq=3 ttl=127 time=78 ms
From 10.1.1.1: bytes=32 seq=4 ttl=127 time=78 ms
From 10.1.1.1: bytes=32 seq=5 ttl=127 time=62 ms

--- 10.1.1.1 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/74/78 ms

这里写图片描述
这里写图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值