Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname core core(config)#vtp mode server Device mode already VTP SERVER. core(config)#vtp domain dayi Changing VTP domain name from NULL to dayi
#IP配置 Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int g0/0 Router(config-if)#ip addr 192.168.10.1 255.255.255.252
ip dhcp excluded-address 192.168.1.1 192.168.1.100 ip dhcp excluded-address 192.168.2.1 192.168.2.100 ip dhcp excluded-address 192.168.3.1 192.168.3.100 ! ip dhcp pool VLAN10 network 192.168.1.0 255.255.255.0 default-router 192.168.1.254 dns-server 113.100.2.56 ip dhcp pool VLAN20 network 192.168.2.0 255.255.255.0 default-router 192.168.2.254 dns-server 113.100.2.56 ip dhcp pool VLAN30 network 192.168.3.0 255.255.255.0 default-router 192.168.3.254 dns-server 113.100.2.56
! username dayi password 0 123456
interface GigabitEthernet0/0 ip address 192.168.10.1 255.255.255.252 ip nat inside duplex auto speed auto ! interface GigabitEthernet0/1 ip address 100.1.1.1 255.255.255.0 ip nat outside duplex auto speed auto ! interface GigabitEthernet0/2 no ip address duplex auto speed auto shutdown
router ospf 1 router-id 1.1.1.1 log-adjacency-changes network 100.1.1.0 0.0.0.255 area 0 ! ip nat inside source list 10 interface GigabitEthernet0/1 overload ip nat inside source static tcp 172.16.1.100 80 100.1.1.1 8080
ip route 192.168.1.0 255.255.255.0 192.168.10.2 ip route 192.168.2.0 255.255.255.0 192.168.10.2 ip route 192.168.3.0 255.255.255.0 192.168.10.2 ip route 172.16.1.0 255.255.255.0 192.168.10.2
interface GigabitEthernet0/0 ip address 100.1.1.2 255.255.255.0 duplex auto speed auto ! interface GigabitEthernet0/1 ip address 124.126.100.1 255.255.255.0 duplex auto speed auto ! interface GigabitEthernet0/2 ip address 113.100.2.1 255.255.255.0 duplex auto speed auto
router ospf 1 router-id 2.2.2.2 log-adjacency-changes network 100.1.1.0 0.0.0.255 area 0 network 124.126.100.0 0.0.0.255 area 0 network 113.100.2.0 0.0.0.255 area 1
int g0/0 ip addr 124.126.100.2 255.255.255.0 duplex auto speed auto ! int g0/1 ip addr 202.96.137.1 255.255.255.0 duplex auto speed auto ! int g0/2 ip addr 124.126.200.254 255.255.255.0 duplex auto speed auto
router ospf 1 router-id 3.3.3.3 log-adjacency-changes network 124.126.100.0 0.0.0.255 area 0 network 202.96.137.0 0.0.0.255 area 0 network 124.126.200.0 0.0.0.255 area 0
hostname r4 ! ! int g0/0 ip addr 202.96.137.2 255.255.255.0 ip nat outside duplex auto speed auto ! int g0/1 no ip addr ip nat inside duplex auto speed auto ! int g0/1.70 encapsulation dot1Q 70 ip addr 192.168.70.254 255.255.255.0 ip nat inside ! int g0/1.80 encapsulation dot1Q 80 ip addr 192.168.80.254 255.255.255.0 ip nat inside !
router ospf 1 router-id 4.4.4.4 log-adjacency-changes network 202.96.137.0 0.0.0.255 area 0 ! ip nat inside source list 100 int g0/0 overload
access-list 100 permit ip 192.168.70.0 0.0.0.255 any access-list 100 permit ip 192.168.80.0 0.0.0.255 any
Router(config)#ip domain-name example.com #配置ip域名 Router(config)#ip ssh version 2 #配置ssh版本2 Please create RSA keys (of at least 768 bits size) to enable SSH v2. Router(config)#crypto key generate rsa % Please define a hostname other than Router. Router(config)#hostname r1 #记得先重命名 r1(config)#crypto key generate rsa #生成rsa密钥对 The name for the keys will be: s1.example.com Choose the size of the key modulus in the range of 360 to 4096 for your General Purpose Keys. Choosing a key modulus greater than 512 may take a few minutes.
How many bits in the modulus [512]: 512 % Generating 512 bit RSA keys, keys will be non-exportable...[OK]
r1(config)#username admin secret ccna #用户admin分配的密码是ccna *Mar 1 0:1:55.42: RSA key size needs to be at least 768 bits for ssh version 2 *Mar 1 0:1:55.42: %SSH-5-ENABLED: SSH 1.5 has been enabled r1(config)#line vty 0 15 #配置VTY范围0-15 r1(config-line)#transport input ssh #在VTY上启用SSH的命令 r1(config-line)#login local #设置用户本地验证 Router(config)#ip ssh version 2 #启动
3.路由器特权模式密码、环回接口设置;
进入控制台配置模式的命令是(),设置控制台连接密码为cisco并启用该密码的命令是()和() (1) line console 0 (2) password cisco (3) login
设置特权模式密码为class的命令是()。 (1) enable secret class
设置环回接口
1 2
Router(config)#interface loopback 1 Router(config-if)#ip address ip 子网掩码
4.配置以太通道;
1 2 3 4 5 6 7 8 9 10 11 12 13
s1(config)#interface range fa0/1 - 2 #对fa0/1与fa0/2口设置 s1(config-if-range)#channel-group 1 mode active #用PAgP模式的话把active改为desirable