单臂路由和DHCP中继实验 2020-11-1

 

 

 

 

 

 

 

https://blog.51cto.com/14029008/2321854

R1:

interface Ethernet0/0

no shutdown

!

interface Ethernet0/0.10

 encapsulation dot1Q 10

 ip address 192.168.10.1 255.255.255.0

interface Ethernet0/0.20

 encapsulation dot1Q 20

 ip address 192.168.20.1 255.255.255.0

!

ip dhcp pool ThinkMo

 network 192.168.10.0 255.255.255.0

 default-router 192.168.10.1

 dns-server 192.168.10.1 8.8.8.8

 lease 3 0 0

!

ip dhcp pool Tiger

 network 192.168.20.0 255.255.255.0

 default-router 192.168.20.1

 dns-server 192.168.20.1 8.8.8.8

 lease 3 0 0

!

service dhcp

SW:

interface Ethernet0/0

 switchport trunk encapsulation dot1q

 switchport mode trunk

interface Ethernet0/1

 switchport trunk encapsulation dot1q

 switchport mode trunk

!

Vlan 10

Vlan 20

!

interface Vlan10

 ip address 10.0.0.1 255.255.255.0

 ip helper-address 10.0.0.1

!

interface Vlan20

 ip address 20.0.0.1 255.255.255.0

 ip helper-address 20.0.0.1

SW2:

interface Ethernet0/0

 switchport trunk encapsulation dot1q

 switchport mode trunk

!

interface Ethernet0/1

 switchport access vlan 10

 switchport mode access

!

interface Ethernet0/2

 switchport access vlan 20

 switchport mode access

PC1:

no ip routing

interface Ethernet0/0

no shutdown

ip address dhcp

 

PC2:

no ip routing

interface Ethernet0/0

no shutdown

ip address dhcp

SVI接口能up的几个必要因素:

1)  创建了对应的VLAN   ,比如int vlan 100,我就要创建一个VLAN100

2)  Int vlan 100 需要手动no shutdown

3)  Int vlan 100 可以不划分到VLAN中,接口也能up

posted @ 2020-11-01 07:33  搬砖网工  阅读(117)  评论(0)    收藏  举报