Skip to content

Instantly share code, notes, and snippets.

@rayepeng
Created June 15, 2021 01:21
Show Gist options
  • Save rayepeng/39effbefeae8a1fecec9a3e69e6d06fe to your computer and use it in GitHub Desktop.
Save rayepeng/39effbefeae8a1fecec9a3e69e6d06fe to your computer and use it in GitHub Desktop.
计网配置
# 静态路由协议配置
ip route 202.114.66.0 255.255.255.0 202.114.67.5
ip route 202.114.64.0 255.255.255.0 202.114.67.5
ip route 202.114.65.0 255.255.255.0 202.114.67.5
ip route 192.168.1.0 255.255.255.0 202.114.67.5
# RIP配置
router rip
network 202.114.66.0
network 202.114.67.0
version 2
exit
# switch 划分vlan
Switch1:
conf t
vlan 10
exit
vlan 20
exit
interface fastethernet0/1
switchport access vlan 10
exit
interface fastethernet0/2
switchport access vlan 20
end
Switch2:
conf t
vlan 10
vlan 20
exit
interface fastethernet0/1
switchport access vlan 10
exit
interface fastethernet0/2
switchport access vlan 20
end
# 定义trunk
Switch0:
conf t
interface fastEthernet0/1
switchport mode trunk
exit
interface gigabitEthernet 1/1
switchport mode trunk
exit
interface gigabitEthernet 1/2
switchport mode trunk
exit
Switch1:
conf t
interface gigabitEthernet 1/1
switchport mode trunk
exit
Switch2:
conf t
interface gigabitEthernet 1/2
switchport mode trunk
exit
# 封装802.1
int fastethernet 0/1
no shutdown
int fastethernet 0/1.1
description vlan 10
encapsulation dot1q 10
ip address 202.114.65.1 255.255.255.0
no shutdown
exit
int fastethernet 0/1.2
description vlan 20
encapsulation dot1q 20
ip address 202.114.64.1 255.255.255.0
no shutdown
end
# dhcp配置
配置清单:
Router4:
ip dhcp pool cisco
配置网段
network 192.168.1.0 255.255.255.0
配置网关
default-router 192.168.1.1
# 端口访问控制配置
S1:
ip access-list extended 100
10 permit tcp 202.114.64.0 0.0.0.255 host 202.114.80.100 eq ftp
20 permit tcp 202.114.64.0 0.0.0.255 host 202.114.80.100 eq 20
30 deny tcp 202.114.65.0 0.0.0.255 host 202.114.80.200 eq www
40 permit tcp any host 202.114.80.200 eq www
Exit
interface gigabitethernet 0/1
ip access-group 100 out
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment