云计算专业配置DHCP并且连接Internet实验:
拓扑图如下:
配置命令如下:
LSW3:
system-view
vlan batch 5 7
interface e0/0/2
port link-type access
port default vlan 5
interface e0/0/3
port link-type access
port default vlan 7
interface e0/0/1
port link-type trunk
port trunk allow-pass vlan 5 7
AR4:
system-view
interface g0/0/2
ip add 99.99.6.1 29
interface g0/0/0
ip add 6.6.6.2 30
interface g0/0/1
ip add 6.6.5.2 30
ip route-static 0.0.0.0 0.0.0.0 99.99.6.6
ip route-static 192.168.6.0 255.255.255.0 6.6.5.1
ip route-static 172.168.6.0 255.255.255.0 6.6.5.1
dhcp enable
acl 2000
rule permit source 192.168.6.0 0.0.0.255
rule permit source 172.168.6.0 0.0.0.255
rule deny source any
interface g0/0/2
nat outbound 2000
AR3(DHCP):
system-view
interface g0/0/0
ip address 6.6.6.1 30
ip route-static 0.0.0.0 0.0.0.0 6.6.6.2
dhcp enable
ip pool vlan_5
network 192.168.6.0 mask 24
gateway-list 192.168.6.1
dns-list 114.114.114.114 8.8.8.8
lease day 1 hour 1 minute 1
excluded-ip-address 192.168.6.250 192.168.6.254
ip pool vlan_7
network 172.168.6.0 mask 24
gateway-list 172.168.6.1
dns-list 114.114.114.114 8.8.8.8
lease day 1 hour 1 minute 1
excluded-ip-address 172.168.6.250 172.168.6.254
interface g0/0/0
dhcp select global
LSW4:
system-view
vlan batch 5 6 7
interface vlan 5
ip address 192.168.6.1 24
interface vlan 7
ip add 172.168.6.1 24
interface vlan 6
ip add 6.6.5.1 30
ip route-static 0.0.0.0 0.0.0.0 6.6.5.2
interface g0/0/2
port link-type trunk
port trunk allow-pass vlan 5 6 7
interface g0/0/1
port link-type access
port default vlan 6
dhcp enable
interface vlan 5
dhcp select relay
dhcp relay server-ip 6.6.6.1
interface vlan 7
dhcp select relay
dhcp relay server-ip 6.6.6.1
PC机:
云的配置:
菜菜的代码,希望能够帮助到你哟!