1、DHCP分配地址实验:
第一步:配置接口IP地址,地址池、禁用IP地址、网关、DNS
[R1]int g0/0
[R1-GigabitEthernet0/0]ip add 192.168.1.1 24
[R1]dhcp enable
[R1]dhcp server ip-pool 1 //创建DHCP地址池 名字为1
[R1-dhcp-pool-1]network 192.168.1.0 mask 255.255.255.0 //宣告192.168.1.0网段
[R1-dhcp-pool-1]gateway-list 192.168.1.1 //分配网关
[R1-dhcp-pool-1]dns-list 114.114.114.114 //分配dns
[R1]dhcp server forbidden-ip 192.168.1.2 192.168.1.10 //禁止分配的ip地址段(本机的ip会自动禁止分配)
第二步:在PC上开启DHCP服务,自动获取IP地址
PC1:
PC2:
第三步:在R2路由器上自动分配接口IP地址
[R2]int g0/0
[R2-GigabitEthernet0/0]ip add dhcp-alloc //路由器DHCP自动分配地址
[R2]dis ip int brief
2、IPv6地址实验:
第一步:配置接口IPv6地址:
R1:
[H3C]int g0/0
[H3C-GigabitEthernet0/0]ipv6 add auto // 自动产生ipv6地址
[H3C-GigabitEthernet0/0]dis ipv6 int brief
R2:
[H3C-GigabitEthernet0/0]ipv6 add 2001::1 64
[H3C]dis ipv6 int g0/0
R2:
[H3C]int g0/0
[H3C-GigabitEthernet0/0]ipv6 add 2001::2 64
第三步:R2拼R1:
第四步:不借助DHCP自动配置IPV6 :
R1:
[H3C]int g0/0
[H3C-GigabitEthernet0/0]undo ipv6 add
[H3C-GigabitEthernet0/0]undo ipv6 nd ra halt //解除RA消息抑制(路由器对PC通过RA消息进行前缀和长度的通告)
[H3C-GigabitEthernet0/0]ipv6 add auto
[H3C-GigabitEthernet0/0]dis ipv6 int b
R2:
[H3C]int g0/0
[H3C-GigabitEthernet0/0]undo ipv6 add
[H3C-GigabitEthernet0/0]undo ipv6 nd ra halt //解除RA消息抑制(路由器对PC通过RA消息进行前缀和长度的通告)
[H3C-GigabitEthernet0/0]ipv6 add auto
[H3C-GigabitEthernet0/0]dis ipv6 int b
3、单臂路由实验:
第一步:配置SW的access与trunk:
[SW2]vlan 10
[SW2-vlan10]port g1/0/1
[SW2-vlan10]vlan 20
[SW2-vlan20]port g1/0/2
[SW2-vlan20]int g1/0/3
[SW2-GigabitEthernet1/0/3]port link-type trunk
[SW2-GigabitEthernet1/0/3]port trunk permit vlan 10 20
第二步:配置路由器的vid10与20:
[R1]int g0/0.1
[R1-GigabitEthernet0/0.1]vlan-type dot1q vid 10 //开启802.1q识别并且绑定到vlan10
[R1-GigabitEthernet0/0.1]ip add 192.168.1.254 24
[R1]int g0/0.2
[R1-GigabitEthernet0/0.2]vlan-type dot1q vid 20
[R1-GigabitEthernet0/0.2]ip add 192.168.2.254 24
第三步:PC1与PC2配置IP地址:
第四步:PC1拼PC2: