接⼊层交换机:连接PC机
enable
config t
1、创建相应的vlan
vlan 10
2、连接终端的端⼝加⼊到相应的VLAN
interface range f0/1-2
switchport access vlan 10
exit
3、将交换机与交换机的端⼝配置成TRUNK
interface f0/3
switchport mode trunk
end
汇聚层交换机:
1、交换机与交换机相连的端⼝配置成trunk
Switch(config)#interface range f0/1-2
Switch(config-if-range)#sw m t
2、创建相应的vlan(本汇聚层交换机以下所有vlan)
Switch(config)#vlan 10
核⼼层交换机:
enable
conf t
vlan 10
vlan 20
vlan 30
interface range f0/1-3
switchport trunk en do
switchport mode trunk
exit
interface vlan 10
ip address 192.168.10.254 255.255.255.0
exit
interface vlan 20
ip address 192.168.20.254 255.255.255.0
exit
interface vlan 30
旅游景区ip address 192.168.30.254 255.255.255.0
exit
ip routing //启⽤ip路由功能
interface f0/1
no switchport
ip address 192.168.40.2 255.255.255.0
end
write
enable
conf t
vlan 40
vlan 50
int rang f0/2
switchport trunk en do
switchport mode trunk
exit
interface vlan 40
ip address 100.100.100.1 255.255.255.0 exit
interface vlan 50
ip address 110.110.110.1 255.255.255.0 ip routing
interface f0/1
no switchport
ip address 54.1.1.2 255.255.255.0
end
write
三层
router rip
network 54.1.1.0
network 100.100.100.0
朴树周迅
network 110.110.110.0
路由5
conf t
router rip
network 45.1.1.0
network 54.1.1.0
路由4
en
show ip route
conf t
router rip
network 45.1.1.0
network 64.1.1.0
路由6
en
show ip route
conf t
router rip
network 64.1.1.0
Switch(config)#router rip (将C⽹段添加到RIP)
Switch(config-router)#network 54.1.1.0
Switch(config-router)#network 100.100.100.0
Switch(config-router)#network 110.110.110.0
端⼝映射
端⼝映射:Router(config)#ip nat inside source static tcp 192.168.10.1 80 64.1.1.1 80 NAT
NAT上⽹的思路
1、内⽹做通(ok)
2、外⽹做通(ok)
3、采⽤NAT将内外⽹连通
NAT配置的位置:内⽹与外⽹相交的三层设备上进⾏配置
1、控制内⽹要上⽹的⽹段。
Router(config)#access-list 1 permit 192.168.10.0 0.0.0.255
Router(config)#access-list 1 permit 192.168.20.0 0.0.0.255
2、实现内⽹到外⽹的转换
Router(config)#ip nat inside source list 1 interface f0/1
inside source list 1 :内⽹要上⽹的⽹段
interface f0/1 (本路由器的外⽹接⼝)
3、指定本路由器内外⽹接⼝
Router(config)#interface f0/0
Router(config-if)#ip nat inside
Router(config-if)#exit
Router(config)#interface f0/1
Router(config-if)#ip nat outside
注意:内⽹所有的三层设备需要配置⼀个默认路由到公⽹:
Switch(config)#ip route 0.0.0.0 0.0.0.0 192.168.40.1
端⼝映射:Router(config)#ip nat inside source static tcp 192.168.10.1 80 64.1.1.1 80路由器
路由器端⼝设置ip
1.规划⽹段
2.配置ip
3.配路由协议(让路由层⾯互通)
en
conf t
interface f0/0
no shutdown
ip address 192.168.50.2 255.255.255.0
exit
interface f0/1
no shutdown
ip address 192.168.50.1 255.255.255.0
exit
DHCP
en
conf t
ip dhcp pool pc0
network 192.168.10.0 255.255.255.0
default-router 192.168.10.254
exit
设置DNS
dns-server 192.168.110.2
OSPF
Open Shortest Path First 开放最短路径优化路由协议
show ip route
en
conf t
router ospf 1 //进程号
network 192.168.10.0 0.0.0.255 area 0
network 192.168.20.0 0.0.0.255 area 0
// network 直连⽹段 反⼦⽹掩码 直连⽹段所处区域
公司年检怎么办理虚拟链路
黄志忠虚拟路配置⽅法⼆:(企业⾥⾯标准做法) R2
创建回环接⼝,ip随便
interface loopback 1
ip address 2.2.2.2 255.255.255.0方琼老公杨阳个人简历
将回环接⼝指定为路由的⾝份证
show ip protocols
router ospf 1
router-id 2.2.2.2
write
发布评论