簡單單臂路由實驗

 

clip_image002基本思路:

1:路由器

(1)命名

(2)設置網絡段ip和協議

(3)激活指定端口

2:交換機

(1)命名

(2)添加vlan

(3)將指定端口劃分到指定vlan

(4)將指定端口設置成trunk模式

3:PC(這裏將路由器代替PC)

(1)命名

(2)設置IP並激活

4:查看命令

查看基本配置:show running-config

查看VLAN信息:show vlan-switch

查看trunk信:show interface 具體端口 switchport

查看路由表:show ip route

----------------------------------------------------------

配置文檔:

r1:

enable \\命名

config terminal

hostname r1

interface f0/0.1 \\將指定網段添加指定VLAN並添加協議

ip address 192.168.10.1 255.255.255.0

no shutdown

encapsulation dot1q 2

exit

interface f0/0.2

ip address 192.168.1.1 255.255.255.0 \\將指定網段添加指定VLAN並添加協議

noshutdown

encapsulation dot1q 3

exit

interface f0/0 \\激活端口

no shutdown

end

write

---------------------------------------------------------

sw1:

enable

config terminal \\命名

hostname sw1

exit

vlan database \\添加VLAN

vlan 2

vlan 3

exit

config terminal \\ 將指定端口添加到指定VLAN

interface f0/1

switchport access vlan 2

exit

interface f0/2

switchport access vlan 3

exit

interface f0/0 \\將指定端口設置成trunk模式

switchport mode trunk

end

write

----------------------------------------------------------

PC1:

Enable \\命名並設置IP

config terminal

no ip routing

hostname pc1

interface f0/0

ip address 192.168.10.2 255.255.255.0

no shutdown

end

write

-----------------------------------------------------------

PC2: \\命名並設置IP

enable

config terminal

no ip routing

hostname pc2

interface f0/0

ip address 192.168.1.2 255.255.255.0

no shutdown

end

write

------------------------------------------------------------

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