<SW1>undo terminal monitor
Info: Current terminal monitor is off.
关闭系统监视日志
创建VLAN
[SW3]vlan 2
[SW3-vlan2]vlan 3
更改交换机的接口链路类型
[SW3]int g0/0/2
[SW3-GigabitEthernet0/0/2]port link-type access
修改接口的PVID(将默认ID改为vlan 2)
[SW3-GigabitEthernet0/0/2]port default vlan 2
查看接口与vlan ID的对应关系
[SW3]dis port vlan active[SW3]int g0/0/3 同上
[SW3-GigabitEthernet0/0/1]port link-type trunk (与交换机直连的)
放行vlan(一般精准放行)
[SW3-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3
SW1
[SW1-GigabitEthernet0/0/3]port link-type access
[SW1-GigabitEthernet0/0/3]port default vlan 2
[SW1-GigabitEthernet0/0/4]port link-type access
[SW1-GigabitEthernet0/0/4]port default vlan 3
[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 2 3
[SW1-GigabitEthernet0/0/1]port link-type trunk
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3
SW2
[SW2-GigabitEthernet0/0/2]port link-type access [SW2-GigabitEthernet0/0/2]port default vlan 2
[SW2-GigabitEthernet0/0/3]port link-type access
[SW2-GigabitEthernet0/0/3]port default vlan 3
[SW2-GigabitEthernet0/0/1]port link-type trunk [SW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3
R1(路由器)
下发四个子接口(两个大广播域,左边为vlan 2和vlan 3 右边为vlan 2 和vlan 3)
[R1]int g0/0/0.2
[R1-GigabitEthernet0/0/0.2]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0.2]dot1q termination vid 2
Jan 17 2024 00:25:10-08:00 R1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0.2 has entered the UP state.
[R1-GigabitEthernet0/0/0.2]arp broadcast enable
[R1]int g0/0/0.3
[R1-GigabitEthernet0/0/0.3]ip add 192.168.2.254 24
[R1-GigabitEthernet0/0/0.3]dot1q termination vid 3
Jan 17 2024 00:25:10-08:00 R1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/0.2 has entered the UP state.
[R1-GigabitEthernet0/0/0.3]arp broadcast enable
[R1]int g0/0/1.2
[R1-GigabitEthernet0/0/1.2]ip add 192.168.3.254 24
[R1-GigabitEthernet0/0/1.2]dot1q termination vid 2
Jan 17 2024 00:29:24-08:00 R1 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP
on the interface GigabitEthernet0/0/1.2 has entered the UP state.
[R1-GigabitEthernet0/0/1.2]arp broadcast enable
[R1]int g0/0/1.3
[R1-GigabitEthernet0/0/1.3]ip add 192.168.4.254 24
[R1-GigabitEthernet0/0/1.3]dot1q termination vid 3
Jan 17 2024 00:31:10-08:00 R1 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP
on the interface GigabitEthernet0/0/1.3 has entered the UP state.
[R1-GigabitEthernet0/0/1.3]arp broadcast enable
将四个地址池都配置在路由器上
[R1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R1]ip pool aa
Info: It's successful to create an IP address pool.
[R1-ip-pool-aa]network 192.168.1.0 mask 24
[R1-ip-pool-aa]gateway-list 192.168.1.254
[R1-ip-pool-aa]dns-list 8.8.8.8 114.114.114.114
现将DHCP服务通过路由器子接口下放给vlan 2 [R1-GigabitEthernet0/0/0.2]dhcp select global
[R1-ip-pool-bb]network 192.168.2.0 mask 24
[R1-ip-pool-bb]gateway-list 192.168.2.254
[R1-ip-pool-bb]dns-list 8.8.8.8 114.114.114.114
[R1-GigabitEthernet0/0/0.3]dhcp select global
[R1-ip-pool-cc]network 192.168.3.0 mask 24
[R1-ip-pool-cc]gateway-list 192.168.3.254
[R1-ip-pool-cc]dns-list 8.8.8.8 114.114.114.114
[R1-GigabitEthernet0/0/1.2]dhcp select global
[R1-ip-pool-dd]network 192.168.4.0 mask 24
[R1-ip-pool-dd]gateway-list 192.168.4.254
[R1-ip-pool-dd]dns-list 8.8.8.8 114.114.114.114
[R1]int g0/0/1.3
[R1-GigabitEthernet0/0/1.3]dhcp select global
此时全网通