PS:
dhcp select relay
dhcp relay server-ip
dhcp select global
在SW2中:
#
vlan batch 10 20
#
interface Ethernet0/0/1
port hybrid pvid vlan 10
port hybrid untagged vlan 10
#
interface Ethernet0/0/2
port hybrid pvid vlan 20
port hybrid untagged vlan 20
#
interface Ethernet0/0/3
port hybrid tagged vlan 1 to 4094
#
在SW1中:
#
vlan batch 10 20 30
#
interface Vlanif10
ip address 192.168.10.1 255.255.255.0
dhcp select relay
dhcp relay server-ip 11.0.0.1
#
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
dhcp select relay
dhcp relay server-ip 11.0.0.1
#
interface Vlanif30
ip address 11.0.0.10 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port hybrid tagged vlan 1 to 4094
#
interface GigabitEthernet0/0/2
port hybrid pvid vlan 30
port hybrid untagged vlan 30
#
ip route-static 0.0.0.0 0.0.0.0 11.0.0.1
#
进入R1中:
#
interface GigabitEthernet0/0/0
ip address 11.0.0.1 255.255.255.0
dhcp select global
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.0
#
ip pool dhcp10
gateway-list 192.168.10.1
network 192.168.10.0 mask 255.255.255.0
#
ip pool dhcp20
gateway-list 192.168.20.1
network 192.168.20.0 mask 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 11.0.0.10
#
验证:无