?
PC1
IP: 192.168.1.2
Submask: 255.255.255.0
Gateway: 192.168.1.1
PC2
IP: 192.168.2.2
Submask: 255.255.255.0
Gateway: 192.168.2.1
S3560
en
conf t
vlan 10
exit
vlan 20
exit
interface fa 0/10
switchport access vlan 10
exit
int fa 0/20
switchport access valn 20
exit
interface valn 10
ip address 192.168.1.1 255.255.255.0
no shutdown
exit
interface vlan 20
ip address 192.168.3.1 255.255.255.0
no shutdown
ip routing
end
show ip route
conf t
router ospf 1
network 192.168.1.0 0.0.0.255(通配符/反掩码) area 0
network 192.168.3.0 0.0.0.255(通配符/反掩码) area 0
end
show ip route
R1
en
conf t
interface fa 0/0
no shutdown
ip address 192.168.3.2 255.255.255.0 exit
interface serial 2/0
no shutdown
clock rate 64000
ip address 192.168.4.1 255.255.255.0 end
show ip route
conf t
router ospf 1
network 192.168.3.0 0.0.0.255 area 0
network 192.168.4.0 0.0.0.255 area 0 end
show ip route
R2
en
conf t
interface fa 0/0
no shutdown
ip address 192.168.2.1 255.255.255.0
exit
interface serial 2/0
no shutdown
ip address 192.168.4.2 255.255.255.0
end
show ip route
conf t
router ospf 1
network 192.168.2.0 0.0.0.255 area 0 network 192.168.4.0 0.0.0.255 area 0 end
show ip route
|