no
enable
conf ter
hostname R1
inter g0/0
no shutdown
ip add 192.168.10.1 255.255.255.0
inter g0/1
ip add 192.168.30.1 255.255.255.0
no shutdown
exit
route rip
version 2
network 192.168.10.0
network 192.168.30.0
R2配置
no
enable
conf ter
hostname R2
inter g0/0
no shutdown
ip add 192.168.20.1 255.255.255.0
inter g0/1
ip add 192.168.30.1 255.255.255.0
no shutdown
exit
route rip
version 2
network 192.168.20.0
network 192.168.30.0
enable
conf ter
hostname MS1
vlan 10
name test10
exit
vlan 20
name test20
exit
interface vlan 10
ip add IP_ADDR
interface vlan 20
ip add IP_ADD
inter fa0/1
switchport mode access
switchport access vlan 10
inter fa0/2
switchport mode access
switchport access vlan 20
exit
ip routing
2.设置主机IP地址及网关地址(涉及到多个网络即多个不同的局域网)
3.路由器设备
R1配置
enbale
conf ter
hostname R1
inter g0/0
no shutdown
ip add 192.168.3.1 255.255.255.0
inter g0/1
no shutdown
ip add 192.168.1.1 255.255.255.0
exit
route rip
version 2
network 192.168.1.0
network 192.168.3.0
R2配置
enbale
conf ter
hostname R2
inter g0/0
no shutdown
ip add 192.168.3.2 255.255.255.0
inter g0/1
no shutdown
ip add 192.168.2.1 255.255.255.0
exit
route rip
version 2
network 192.168.2.0
network 192.168.3.0