路由器和交换机的网络联通(OSPF和VLAN间路由)和SSH登录配置
——R1——
en
conf t
int s1/1
ip add 10.10.10.1 255.255.255.252
no shut
int s1/0
no shut
ip add 10.10.10.5 255.255.255.252
int f2/0
no shut
int f2/0.100
enc dot1 100
ip add 192.168.100.1 255.255.255.252
exit
router ospf 10
net 10.10.10.0 0.0.0.3 area 0
net 10.10.10.4 0.0.0.3 area 0
net 192.168.100.0 0.0.0.3 area 0
exit
hostname R1
ip domain-name cisco
username cisco password cisco
enable pass cisco
crypto key generate rsa
1024
line vty 0 15
login local
transport input ssh
do wr
——R2——
en
conf t
int s1/2
ip add 10.10.10.9 255.255.255.252
no shut
int s1/0
ip add 10.10.10.5 255.255.255.252
no shut
int f2/0
no shut
int f2/0.100
enc dot1 100
ip add 192.168.100.5 255.255.255.252
exit
router ospf 10
net 10.10.10.4 0.0.0.3 area 0
net 10.10.10.8 0.0.0.3 area 0
net 192.168.70.0 0.0.0.255 area 0
net 192.168.100.4 0.0.0.3 area 0
exit
hostname R2
ip domain-name cisco
username cisco password cisco
enable pass cisco
crypto key generate rsa
1024
line vty 0 15
login local
transport input ssh
do wr
——R3——
en
conf t
int s1/1
ip add 10.10.10.2 255.255.255.252
no shut
int s1/2
ip add 10.10.10.10 255.255.255.252
no shut
int f2/0
no shut
int f2/0.70
enc dot1 70
ip add 192.168.70.1 255.255.255.0
int f2/0.100
enc dot1 100
ip add 192.168.100.9 255.255.255.252
exit
router ospf 10
net 10.10.10.8 0.0.0.3 area 0
net 10.10.10.0 0.0.0.3 area 0
net 192.168.100.8 0.0.0.3 area 0
exit
hostname R3
ip domain-name cisco
username cisco password cisco
enable pass cisco
crypto key generate rsa
1024
line vty 0 15
login local
transport input ssh
do wr
——S1——
vlan data
vlan 100
exit
conf t
int f1/0
sw tr en do
swi mode tru
int vlan 100
ip add 192.168.100.2 255.255.255.252
no ip routing
ip default-gateway 192.168.100.1
hostname S1
ip domain-name cisco
username cisco password cisco
enable pass cisco
crypto key generate rsa
1024
line vty 0 15
login local
transport input ssh
do wr
——S2——
vlan data
vlan 100
exit
conf t
int f1/0
sw tr en do
swi mode tru
int vlan 100
ip add 192.168.100.6 255.255.255.252
no ip routing
ip default-gateway 192.168.100.5
hostname S2
ip domain-name cisco
username cisco password cisco
enable pass cisco
crypto key generate rsa
1024
line vty 0 15
login local
transport input ssh
do wr
——S3——
vlan data
vlan 70
vlan 100
exit
conf t
int f1/1
swi mode acc
swi acc vlan 70
int f1/0
sw tr en do
swi mode tru
int vlan 100
ip add 192.168.100.10 255.255.255.252
no ip routing
ip default-gateway 192.168.100.9
hostname S3
ip domain-name cisco
username cisco password cisco
enable pass cisco
crypto key generate rsa
1024
line vty 0 15
login local
transport input ssh
do wr