实现不同网段pc机及交换机互通
网络拓扑:
1. 设置pc0 IP 地址 192.168.1.1
2. 设置pc1 IP 地址 192.168.1.2
3. 设置pc2 IP 地址 192.168.2.1
4. 设置pc3 IP 地址 192.168.2.2
5. 设置s1 IP 192.168.1.254 255.255.255.0
Switch>enable
Switch#configureterminal
Switch(config)#hostnames1
s1(config)#interfacevlan 1
s1(config-if)#ipaddress 192.168.1.254 255.255.255.0
s1(config-if)#noshutdown
interface Vlan1
ip address 192.168.1.254 255.255.255.0
6.Switch>enable
Switch#configureterminal
Switch(config)#interfacevlan 1
Switch(config-if)#ipaddress 192.168.2.254 255.255.255.0
Switch(config-if)#noshutdown
Switch(config)#hostnames2
7.Router>enable
Router#configureterminal
Router(config)#interfacefastEthernet 0/0
Router(config-if)#ipaddress 192.168.1.254 255.255.255.0
Router(config-if)#noshutdown
Router(config-if)#exit
Router(config)#interfacefastEthernet 0/1
Router(config-if)#ipaddress 192.168.2.254 255.255.255.0
Router(config-if)#noshutdown
interface FastEthernet0/0
ip address 192.168.1.254 255.255.255.0
duplex auto
speed auto
!
interfaceFastEthernet0/1
ip address 192.168.2.254 255.255.255.0
duplex auto
speed auto
原文地址:http://315805980.blog.51cto.com/2027806/1555291