
Fabian Tech Tips

Quick Cisco configuration command reference
Feb 17
4 min read
0
6
0
Quick Cisco configuration command reference
Configuring a Router Interface:
Router1>enable: Enter privileged EXEC mode.
Router1#configure terminal: Enter global configuration mode.
Router1(config)#interface FastEthernet0/0: Specify the interface to configure.
Router1(config-if)#description Private LAN: Add a descriptive label to the interface.
Router1(config-if)#speed 100: Set the interface speed to 100 Mbps.
Router1(config-if)#duplex full: Set the interface duplex mode to full.
Router1(config-if)#ip address 192.168.1.1 255.255.255.0: Assign an IP address and subnet mask to the interface.
Router1(config-if)#no shutdown: Enable the interface.
Configuring a Switch Management Interface:
Switch1>enable: Enter privileged EXEC mode.
Switch1#configure terminal: Enter global configuration mode.
Switch1#interface VLAN 1: Specify the VLAN interface to configure.
Switch1(config-if)#ip address 192.168.1.241 255.255.255.0: Assign an IP address and subnet mask to the VLAN interface.
Configuring an Interface to Use DHCP:
Router1>enable: Enter privileged EXEC mode.
Router1#configure terminal: Enter global configuration mode.
Router1(config)#interface FastEthernet0/0: Specify the interface to configure.
Router1(config-if)#ip dhcp: Enable DHCP on the interface.
Creating a VLAN:
Switch1>enable: Enter privileged EXEC mode.
Switch1#configure terminal: Enter global configuration mode.
Switch1(config)#interface vlan 2: Create VLAN 2.
Switch1(config-if)#description Finance VLAN: Add a descriptive label to the VLAN.
Switch1(config-if)#exit: Exit VLAN interface configuration mode.
Switch1(config)#interface range FastEthernet 0/1 , FastEthernet 0/12: Specify a range of interfaces.
Switch1(config-if-range)#switchport mode access: Configure the interfaces as access ports.
Switch1(config-if-range)#switchport access vlan 2: Assign VLAN 2 to the interfaces.
Configuring a Trunk Port:
Switch1>enable: Enter privileged EXEC mode.
Switch1#configure terminal: Enter global configuration mode.
Switch1(config)#interface FastEthernet 0/24: Specify the interface to configure.
Switch1(config-if-range)#switchport mode trunk: Configure the interface as a trunk port.
Configuring EtherChannel:
Switch1>enable: Enter privileged EXEC mode.
Switch1#configure terminal: Enter global configuration mode.
Switch1(config)#interface range FastEthernet0/11 -12: Specify a range of interfaces.
Switch1(config-if-range)#switchport mode access: Configure the interfaces as access ports.
Switch1(config-if-range)#switchport access vlan 10: Assign VLAN 10 to the interfaces.
Switch1(config-if-range)#channel-group 5 mode desirable: Configure the interfaces to form a channel group and negotiate using PAgP.
Configuring Spanning Tree Protocol:
Switch1>enable: Enter privileged EXEC mode.
Switch1#configure terminal: Enter global configuration mode.
Switch1(config)#spanning-tree mode rapid-pvst: Enable Rapid PVST.
Switch1(config)#interface FastEthernet 0/2: Specify the interface to configure.
Switch1(config-if)#spanning-tree portfast: Enable PortFast on the interface.
Enabling Routing:
Router1>enable: Enter privileged EXEC mode.
Router1#configure terminal: Enter global configuration mode.
Router1(config)#ip routing: Enable IP routing.
Configuring a Static Route:
Router1>enable: Enter privileged EXEC mode.
Router1#configure terminal: Enter global configuration mode.
Router1(config)#ip route 192.168.5.0 255.255.255.0 192.168.3.2: Add a static route to the 192.168.5.0/24 network.
Configuring RIP:
Router2>enable: Enter privileged EXEC mode.
Router2#configure terminal: Enter global configuration mode.
Router2(config)#ip routing: Enable IP routing.
Router2(config)#router rip: Enable RIP.
Router2(config-router)#version 2: Configure RIP version 2.
Router2(config-router)#no auto-summary: Disable auto-summary.
Router1(config-router)#network 192.168.5.0: Advertise the 192.168.5.0 network.
Router2(config-router)#neighbor 192.168.1.1: Specify a neighbor for RIP.
Configuring EIGRP:
Router2>enable: Enter privileged EXEC mode.
Router2#configure terminal: Enter global configuration mode.
Router2(config)#ip routing: Enable IP routing.
Router2(config)#router eigrp 100: Enable EIGRP with AS number 100.
Router2(config-router)#network 192.168.1.0: Advertise the 192.168.1.0 network.
Router2(config-router)#network 192.168.5.0: Advertise the 192.168.5.0 network.
Router2(config-router)#no auto-summary: Disable auto-summary.
Configuring OSPF:
Router2>enable: Enter privileged EXEC mode.
Router2#configure terminal: Enter global configuration mode.
Router2(config)#interface loopback 0: Configure the loopback interface.
Router2(config-if)#ip address 192.168.255.254 255.255.255.0: Assign an IP address to the loopback interface.
Router2(config-if)#exit: Exit interface configuration mode.
Router2(config)#router ospf 100: Enable OSPF with process ID 100.
Router2(config-router)#network 192.168.255.254 0.0.0.0 area 0: Advertise the loopback network.
Router2(config-router)#network 192.168.5.0 0.0.0.255 area 0: Advertise the 192.168.5.0 network.
Viewing Routing Information:
Router2>enable: Enter privileged EXEC mode.
Router2#show ip route: Display the IP routing table.
Configuring NAT:
Router1>enable: Enter privileged EXEC mode.
Router1#configure terminal: Enter global configuration mode.
Router1(config)#access-list 1 permit 10.0.0.0 0.255.255.255: Create an access list to permit traffic from the 10.0.0.0/24 network.
Router1(config)#ip nat inside source list 1 interface FastEthernet 0/0 overload: Configure NAT overload on the FastEthernet 0/0 interface.
Router1(config)#interface FastEthernet0/0: Specify the outside interface.
Router1(config-if)#ip nat outside: Configure the interface as the outside interface.
Router1(config-if)#interface FastEthernet0/1: Specify the inside interface.
Router1(config-if)#ip nat inside: Configure the interface as the inside interface.
Configuring an ACL:
Switch1>enable: Enter privileged EXEC mode.
Switch1#configure terminal: Enter global configuration mode.
**Switch1(config)#access-list 50 permit 192.168
########################################
BGP
Cisco Routers
To configure BGP on a Cisco router, you can use the following commands:
router bgp <AS-number> neighbor <peer-IP-address> remote-as <peer-AS-number> network <network-address> mask <subnet-mask>
For example, to configure BGP on R1 with AS number 100 and peer router R2 with IP address 192.168.1.2 and AS number 200, you would use the following commands:
router bgp 100 neighbor 192.168.1.2 remote-as 200 network 10.1.1.1 mask 255.255.255.255
This configuration will establish a BGP peering session between the two routers and advertise the network 10.1.1.1/32 to R2.
Similarly, on R2, you would use the following commands:
router bgp 200 neighbor 192.168.1.1 remote-as 100 network 20.2.2.2 mask 255.255.255.255
Juniper Routers
To configure BGP on a Juniper router, you can use the following commands:
set protocols bgp group <group-name> type external set protocols bgp group <group-name> local-address <local-IP-address> set protocols bgp group <group-name> neighbor <peer-IP-address> peer-as <peer-AS-number>
For example, to configure BGP on R1 with peer router R2 with IP address 192.168.1.2 and AS number 200, you would use the following commands:
set protocols bgp group ebgp-peers type external set protocols bgp group ebgp-peers local-address 192.168.1.1 set protocols bgp group ebgp-peers neighbor 192.168.1.2 peer-as 200
This configuration will establish a BGP peering session between the two routers.
Similarly, on R2, you would use the following commands:
set protocols bgp group ebgp-peers type external set protocols bgp group ebgp-peers local-address 192.168.1.2 set protocols bgp group ebgp-peers neighbor 192.168.1.1 peer-as 100