單臂路由

 

clip_image002思路:

(一)對於路由器:

1:命名

2:禁止DNS服務

3:設置子接口協議和IP

4:開通相應接口

(二)對於交換機:

1:命名

2:添加vlan

3:將指定端口添加到相應vlan

4:將相應端口設置成trunk模式

(三)對於PC:(這裏把路由器當做PC)

1:命名

2:禁用路由功能

3:設置IP

(四)查看命令:

查看基本配置:

show running-config

查看端口命令:

show interface 端口號

查看vlan信息:

show vlan-switch

配置文檔:

R:

enable

config terminal

no ip domain-lookup //禁用DNS服務

hostname R

interface f0/0 //激活端口

no shutdown

exit

interface f0/0.1

encapsulation dot1q 2 //將相應端口添加協議並設置IP

ip address 192.168.1.35 255.255.255.224

no shutdown

exit

interface f0/0.2

encapsulation dot1q 3

ip address 192.168.1.67 255.255.255.224 //將相應端口添加協議並設置IP

no shutdown

end

write

sw1:

enable

config terminal

hostname sw1 //命名

exit

vlan database //添加vlan

vlan 2

vlan 3

exit

config terminal

interface f0/8

switchport access vlan 2 //將相應端口添加到相應vlan

interface f0/10

switchport access vlan 3 //將相應端口添加到相應vlan

exit

interface f0/1

switchport mode trunk //將相應端口設置成中繼

interface f0/2

switchport mode trunk //將相應端口設置成中繼

end

write

sw2:

enable

config terminal

hostname sw2 //命名

exit

vlan database //添加vlan

vlan 2

vlan 3

exit

config terminal

interface f0/8

switchport access vlan 2 //將相應端口添加到相應vlan

interface f0/10

switchport access vlan 3 //將相應端口添加到相應vlan

exit

interface f0/1

switchport mode trunk //將相應端口設置成trunk模式

end

write

PC1:

enable

config terminal

no ip routing

hostname PC1

interface f0/0

ip address 192.168.1.33 255.255.255.224 //設置IP

no shutdown

end

write

PC2:

enable

config terminal

no ip routing

hostname PC2

interface f0/0

ip address 192.168.1.65 255.255.255.224 //設置IP

no shutdown

end

write

PC3:

enable

config terminal

no ip routing

hostname PC3

interface f0/0

ip address 192.168.1.34 255.255.255.224 //設置IP

no shutdown

end

write

PC4:

enable

config terminal

no ip routing

hostname PC4

interface f0/0

ip address 192.168.1.66 255.255.255.224 //設置IP

no shutdown

end

write

測試截圖:

路由器上查看鄰居:

clip_image004

交換機上查看鄰居:

clip_image006

交換機2上查看vlan:

clip_image008

交換機1上查看vlan:

clip_image010

交換機上查看trunk端口:

clip_image012

交換機上查看trunk端口:

clip_image014

交換機上查看trunk端口:

clip_image016

在PC1上Ping其它PC.:

clip_image018

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章