cisco的三層交換上怎麼給不同vlan配置不同的dhcp呀

2021-03-21 00:50:02 字數 5515 閱讀 7652

1樓:匿名使用者

三層交換機的配置:

configure terminal

vlan 10

vlan 20

vlan 30 //建立vlan 10,20,30

inte***ce vlan 10

ip add 192.168.10.1 255.255.255.0 //vlan10的閘道器地址192.168.10.1

exit

ip dhcp excluded-address 192.168.10.1 //將閘道器地址從地址池中剔除

ip dhcp pool vlan10 //配置dhcp地址池,名字vlan10

***work 192.168.10.0 255.255.255.0 //定義dhcp地址池的地址範圍

default-router 192.168.10.1 //定義該地址池的閘道器地址

dns-server 211.0.0.2 //配置dns伺服器

inte***ce vlan 20

ip add 192.168.20.1 255.255.255.0 //vlan20的閘道器地址192.168.20.1

exit

ip dhcp excluded-address 192.168.20.1 //將閘道器地址從地址池中剔除

ip dhcp pool vlan20 //配置dhcp地址池,名字vlan20

***work 192.168.20.0 255.255.255.0 //定義dhcp地址池的地址範圍

default-router 192.168.20.1 //定義該地址池的閘道器地址

dns-server 211.0.0.2 //配置dns伺服器

inte***ce vlan 30

ip add 192.168.30.1 255.255.255.0 //vlan30的閘道器地址192.168.30.1

exit

ip dhcp excluded-address 192.168.30.1 //將閘道器地址從地址池中剔除

ip dhcp pool vlan30 //配置dhcp地址池,名字vlan30

***work 192.168.30.0 255.255.255.0 //定義dhcp地址池的地址範圍

default-router 192.168.30.1 //定義該地址池的閘道器地址

dns-server 211.0.0.2 //配置dns伺服器

inte***ce f0/1 //假設f0/1連線一個二層交換機

switchport mode trunk //配置trunk模式

switchport trunk native vlan 10 //配置本徵vlan

exit //另一個埠配置類似

ip routing //開啟三層功能

其中連線三層交換機f0/1埠的二層交換機配置如:

conf t

vlan 10

vlan 20

vlan 30

inte***ce f0/1

switchport access vlan 10 //假設f0/1連線vlan10,其他幾個vlan埠配置類似

int f0/24 //假設f0/24連線三層交換機

switchport mode trunk

switchport trunk native vlan10 //配置本徵vlan,需要與三層交換機上的對應埠的本徵vlan一致

exit

//另一個交換機類似

//主機ip用自動獲取

2樓:

首先建立四個vlan,10、

20、30、40,10、20、30做不同的閘道器,40做dhcp伺服器閘道器,介面地址配置為10.130.100.

0/24,10.130.101.

0/24,10.130.102.

0/24,10.129.0.

1/24,dhcp伺服器可以配置地址10.129.0.

2/24,然後在vlan介面下面新增一條ip helper-address 10.129.0.

2就可以了,dhcp伺服器裡面建立三個作用域,分別是把三個網段的地址新增進去就可以了!

具體的地址怎麼安排分配就看你有多少臺pc,要怎麼來分了!

3樓:

可以用dhcp伺服器嗎?可以的話用iphelper就異常簡單了

4樓:匿名使用者

在核心上

ip dhcp excluded-address 192.168.23.1 192.168.23.49

ip dhcp excluded-address 192.168.21.1 192.168.21.49

ip dhcp excluded-address 192.168.22.1 192.168.22.49

ip dhcp excluded-address 192.168.24.1 192.168.24.49

ip dhcp excluded-address 192.168.25.1 192.168.25.49

ip dhcp excluded-address 192.168.26.1 192.168.26.49

ip dhcp excluded-address 192.168.31.1 192.168.31.49

ip dhcp excluded-address 192.168.32.1 192.168.32.49

ip dhcp excluded-address 192.168.33.1 192.168.33.49

ip dhcp excluded-address 192.168.34.1 192.168.34.49

ip dhcp excluded-address 192.168.35.1 192.168.35.49

ip dhcp excluded-address 192.168.37.1 192.168.37.49

ip dhcp excluded-address 192.168.27.1 192.168.27.49

ip dhcp excluded-address 192.168.28.1 192.168.28.49

ip dhcp excluded-address 192.168.29.1 192.168.29.49

ip dhcp excluded-address 192.168.30.1 192.168.30.49

ip dhcp excluded-address 192.168.20.1 192.168.20.49

ip dhcp excluded-address 192.168.151.1 192.168.151.49

!ip dhcp pool 23

***work 192.168.23.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.23.1

!ip dhcp pool 21

***work 192.168.21.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.21.1

!ip dhcp pool 22

***work 192.168.22.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.22.1

lease 30

!ip dhcp pool 24

***work 192.168.24.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.24.1

!ip dhcp pool 25

***work 192.168.25.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.25.1

lease 30

!ip dhcp pool 26

***work 192.168.26.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.26.1

lease 30

!ip dhcp pool 31

***work 192.168.31.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.31.1

lease 30

!ip dhcp pool 32

***work 192.168.32.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.32.1

lease 30

!ip dhcp pool 33

***work 192.168.33.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.33.1

!ip dhcp pool 34

***work 192.168.34.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.34.1

lease 30

!ip dhcp pool 35

***work 192.168.35.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.35.1

lease 30

!ip dhcp pool 37

***work 192.168.37.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.37.1

lease 30

!ip dhcp pool 27

***work 192.168.27.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.27.1

lease 30

!ip dhcp pool 28

***work 192.168.28.0 255.255.255.0

dns-server 202.106.0.20 202.106.148.1

default-router 192.168.28.1

lease 30

cisco 3560三層交換機同交換機,在同網段,不同的vlan可以實現通訊。這是學校出的一道題目

3560算是低端的三層交換機,但基本功能還是有了。只是你在配置裡開了ip routing,不同的的vlan應該就可以互相通訊。如果不使用匯聚模式,vlan將一臺交換機變成了多臺無聯絡的交換機。無論客戶機ip地址如何設定,不同vlan間無法通訊 當然可以啊,開了路由就可以做了。3560是三層交換機,有...

關於三層交換機與二層交換機的配置

在三層交換機上啟用 iprouting,這樣各個網段之間都可以互相訪問了。要達到每個vlan只能與管理vlan訪問的目的,需要設定acl 訪問控制列表 然後套用到每個攝像頭的vlan上 vlan在3層交換機上做,3層交換機與2層交換機連線口配置trunk,vlan資訊分發到2層交換機,2層交換機的埠...

請問路由器和三層交換機的區別

你好!以上都是高手。但是個人的簡單的見解如下 基本不能替代,路由器與交換機的主要區別體現在以下幾個方面 1 工作層次不同 最初的的交換機是工作在osi rm開放體系結構的資料鏈路層,也就是第二層,而路由器一開始就設計工作在osi模型的網路層。由於交換機工作在osi的第二層 資料鏈路層 所以它的工作原...