交换机基础配置
//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