题目:
- 先对交换机进行vlan操作
aw1:
[Huawei]sys sw1
May 13 2023 21:32:46-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 4, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1]vlan batch 10 20
May 13 2023 21:33:26-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 5, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1]inter g 0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk
May 13 2023 21:37:56-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 6, the c
hange loop count is 0, and the maximum number of records is 4095.p
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20
[sw1-GigabitEthernet0/0/1]q
May 13 2023 21:38:36-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.g
[sw1]inter GigabitEthernet 0/0/2
[sw1-GigabitEthernet0/0/2]port link-type access
May 13 2023 21:39:16-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 8, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-GigabitEthernet0/0/2]port default vlan 10
May 13 2023 21:39:46-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095.n
[sw1-GigabitEthernet0/0/2]inter g 0/0/3
[sw1-GigabitEthernet0/0/3]port link-type access
May 13 2023 21:40:26-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 10, the
change loop count is 0, and the maximum number of records is 4095.
[sw1-GigabitEthernet0/0/3]port default vlan 20
aw2略
- 对子接口进行IP设置,并声明该子接口所处理的VLAN标签,和开启其ARP广播功能
接口0/0/1
[r1]inter g 0/0/1.1
[r1-GigabitEthernet0/0/1.1]ip add 192.168.3.254 24
[r1-GigabitEthernet0/0/1.1]dot1q termination vid 10
[r1-GigabitEthernet0/0/1.1]arp broadcast enable
[r1-GigabitEthernet0/0/1.1]inter g 0/0/1.2
[r1-GigabitEthernet0/0/1.2]ip add 192.168.4.254 24
[r1-GigabitEthernet0/0/1.2]dot1q termination vid 20
[r1-GigabitEthernet0/0/1.2]arp broadcast enable
接口0/0/0略
- 建立IP pool并调用
[r1]dhcp enable
[r1]ip pool 001.1
Info: It's successful to create an IP address pool.
[r1-ip-pool-001.1]network 192.168.3.0 mask 24
[r1-ip-pool-001.1]gateway-list 192.168.3.154
[r1-ip-pool-001.1]dns-list 8.8.8.8
[r1-ip-pool-001.1]inter g 0/0/1.1
[r1-GigabitEthernet0/0/1.1]dhcp select global
其他略
- 对pc开启DHCP并ipconfig查pc的ip,然后ping其他pc
pc2
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe4e:9b1
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.2.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.2.254
Physical address..................: 54-89-98-4E-09-B1
DNS server........................: 8.8.8.8
pc1
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fecf:24e2
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.254
Physical address..................: 54-89-98-CF-24-E2
DNS server........................: 8.8.8.8
PC>ping 192.168.2.253
Ping 192.168.2.253: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.253: bytes=32 seq=2 ttl=127 time=78 ms
From 192.168.2.253: bytes=32 seq=3 ttl=127 time=78 ms
From 192.168.2.253: bytes=32 seq=4 ttl=127 time=78 ms
From 192.168.2.253: bytes=32 seq=5 ttl=127 time=63 ms
--- 192.168.2.253 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/74/78 ms
其它略