background image

 

[SwitchB-vlan6] port gigabitEthernet 1/0/3 

[SwitchB-vlan6] quit 

# Configure GigabitEthernet 1/0/1 as a trunk port, and allow packets from all VLANs to pass 
through the trunk port. 

[SwitchB] interface gigabitEthernet 1/0/1 

[SwitchB-GigabitEthernet1/0/1] port link-type trunk 

[SwitchB-GigabitEthernet1/0/1] port trunk permit vlan all 

[SwitchB-GigabitEthernet1/0/1] quit 

2. 

Configure Switch A. 

# Enable DHCP. 

<SwitchA> system-view 

[SwitchA] dhcp enable 

# Create VLAN 5, VLAN 6, and VLAN 7, and then assign GigabitEthernet 1/0/2 to VLAN 7. 

[SwitchA] vlan 5 to 7 

[SwitchA] interface GigabitEthernet 1/0/2 

[SwitchA-GigabitEthernet1/0/2] port access vlan 7 

[SwitchA-GigabitEthernet1/0/2] quit 

# Configure GigabitEthernet 1/0/1 as a trunk port, and allow packets from all VLANs to pass 
through the trunk port. 

[SwitchA] interface gigabitEthernet 1/0/1 

[SwitchA-GigabitEthernet1/0/1] port link-type trunk 

[SwitchA-GigabitEthernet1/0/1] port trunk permit vlan all 

[SwitchA-GigabitEthernet1/0/1] quit 

# Assign an IP address to VLAN 5, VLAN 6, and VLAN 7, respectively. 

[SwitchA] interface vlan-interface 5 

[SwitchA-Vlan-interface5] ip address 192.168.5.1 255.255.255.0 

[SwitchA-Vlan-interface5] quit 

[SwitchA] interface vlan-interface 6 

[SwitchA-Vlan-interface6] ip address 192.168.6.1 255.255.255.0 

[SwitchA-Vlan-interface6] quit 

[SwitchA]interface vlan-interface 7 

[SwitchA-Vlan-interface7] ip address 192.168.7.1 255.255.255.0 

[SwitchA-Vlan-interface7] quit 

# Enable the DHCP relay agent mode on VLAN-interface 5. 

[SwitchA] interface vlan-interface 5 

[SwitchA-Vlan-interface5] dhcp select relay 

# Assign IP address 192.168.7.100 to the DHCP server. 

[SwitchA-Vlan-interface5] dhcp relay server-address 192.168.7.100 

# Enable the DHCP relay agent mode on VLAN-interface 6. 

[SwitchA] interface vlan-interface 6 

[SwitchA-Vlan-interface6] dhcp select relay 

# Assign IP address 192.168.7.100 to the DHCP server. 

[SwitchA-Vlan-interface6] dhcp relay server-address 192.168.7.100 

3. 

Configure DHCP server. Details are not shown. 

# Assign IP address 192.168.7.100/24 to the NIC of the DHCP server. 

# Configure IP address 192.168.7.1 as the gateway for the DHCP server. 

# Make sure the DHCP server can ping 192.168.5.1 and 192.168.6.1. 

Summary of Contents for DHCP

Page 1: ...oduced or transmitted in any form or by any means without prior written consent of New H3C Technologies Co Ltd Except for the trademarks of New H3C Technologies Co Ltd any trademarks that may be menti...

Page 2: ...nfiguration 5 Procedure 5 Verifying the configuration 7 Configuration files 7 Related documentation 8 Configuring DHCP snooping 9 Introduction 9 Network configuration 9 Procedure 9 Verifying the confi...

Page 3: ...The IP addresses of VLAN interface 5 VLAN interface 6 and VLAN interface 7 on the switch are 192 168 5 254 24 192 168 6 254 24 and 192 168 7 254 24 respectively For the hosts in subnet 192 168 5 0 24...

Page 4: ...cific IP addresses such as DNS server IP addresses from dynamic IP address assignment Switch dhcp server forbidden ip 192 168 5 100 Switch dhcp server forbidden ip 192 168 6 100 Switch dhcp server for...

Page 5: ...2021 Auto C 662e 3030 3033 2d45 7568 6572 1e The output shows that the DHCP server can assign IP addresses and other network settings to the clients on subnets 192 168 5 0 24 192 168 6 0 24 and 192 16...

Page 6: ...igabitEthernet1 0 5 port link mode bridge port access vlan 5 interface GigabitEthernet1 0 6 port link mode bridge port access vlan 6 interface GigabitEthernet1 0 7 port link mode bridge port access vl...

Page 7: ...network to meet the following requirements The DHCP clients run on subnets 192 168 5 0 24 and 192 168 6 0 24 and the DHCP server IP address is 192 168 7 100 24 Switch A acts as the DHCP relay agent f...

Page 8: ...ddress to VLAN 5 VLAN 6 and VLAN 7 respectively SwitchA interface vlan interface 5 SwitchA Vlan interface5 ip address 192 168 5 1 255 255 255 0 SwitchA Vlan interface5 quit SwitchA interface vlan inte...

Page 9: ...rt access vlan 5 interface GigabitEthernet1 0 3 port link mode bridge port access vlan 6 Switch A dhcp enable vlan 5 to 7 interface Vlan interface5 ip address 192 168 5 1 255 255 255 0 dhcp select rel...

Page 10: ...rnet1 0 2 port link mode bridge port access vlan 7 Related documentation DHCP configuration in the Layer 3 IP services configuration guide for the device DHCP commands in the Layer 3 IP services comma...

Page 11: ...erver The DHCP snooping device records clients IP to MAC bindings by reading DHCP ACK messages received from the trusted port and the DHCPREQUEST messages Figure 3 Network diagram Procedure Enable glo...

Page 12: ...k the DHCP snooping entry recorded for the client Configuration files dhcp snooping enable interface GigabitEthernet1 0 1 port link mode bridge dhcp snooping trust interface Ten GigabitEthernet1 0 2 p...

Page 13: ...connectivity Figure 4 Network diagram Procedure 1 Configure Switch A Create VLAN 1 and assign GigabitEthernet 1 0 2 to VLAN 1 SwitchA system view SwitchA vlan 1 SwitchA vlan1 port gigabitethernet 1 0...

Page 14: ...the next hop of the route is 3001 2 SwitchA ipv6 route static 4001 64 3001 2 Save the configuration SwitchA save force 2 Configure Switch B Create VLAN 2 and assign GigabitEthernet 1 0 1 to VLAN 2 Swi...

Page 15: ...n View the IPv6 addresses assigned by the DHCPv6 server on Switch A SwitchA display ipv6 dhcp server ip in use Pool 1 IPv6 address Type Lease expiration 2001 2 Auto C Sep 30 11 45 07 2021 View informa...

Page 16: ...ver apply pool 1 allow hint rapid commit ipv6 address 2001 1 64 ipv6 nd autoconfig managed address flag undo ipv6 nd ra halt interface Vlan interface2 ipv6 address 3001 1 64 interface GigabitEthernet1...

Page 17: ...a halt interface GigabitEthernet1 0 1 port link mode bridge port access vlan 2 interface GigabitEthernet1 0 2 port link mode bridge port access vlan 3 ipv6 route static 2001 64 3001 1 Related document...

Reviews: