top of page

Quick Cisco configuration command reference

Feb 17

4 min read

0

6

0


Quick Cisco configuration command reference


Configuring a Router Interface:

  1. Router1>enable: Enter privileged EXEC mode.

  2. Router1#configure terminal: Enter global configuration mode.

  3. Router1(config)#interface FastEthernet0/0: Specify the interface to configure.

  4. Router1(config-if)#description Private LAN: Add a descriptive label to the interface.

  5. Router1(config-if)#speed 100: Set the interface speed to 100 Mbps.

  6. Router1(config-if)#duplex full: Set the interface duplex mode to full.

  7. Router1(config-if)#ip address 192.168.1.1 255.255.255.0: Assign an IP address and subnet mask to the interface.

  8. Router1(config-if)#no shutdown: Enable the interface.


Configuring a Switch Management Interface:

  1. Switch1>enable: Enter privileged EXEC mode.

  2. Switch1#configure terminal: Enter global configuration mode.

  3. Switch1#interface VLAN 1: Specify the VLAN interface to configure.

  4. 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:

  1. Router1>enable: Enter privileged EXEC mode.

  2. Router1#configure terminal: Enter global configuration mode.

  3. Router1(config)#interface FastEthernet0/0: Specify the interface to configure.

  4. Router1(config-if)#ip dhcp: Enable DHCP on the interface.


Creating a VLAN:

  1. Switch1>enable: Enter privileged EXEC mode.

  2. Switch1#configure terminal: Enter global configuration mode.

  3. Switch1(config)#interface vlan 2: Create VLAN 2.

  4. Switch1(config-if)#description Finance VLAN: Add a descriptive label to the VLAN.

  5. Switch1(config-if)#exit: Exit VLAN interface configuration mode.

  6. Switch1(config)#interface range FastEthernet 0/1 , FastEthernet 0/12: Specify a range of interfaces.

  7. Switch1(config-if-range)#switchport mode access: Configure the interfaces as access ports.

  8. Switch1(config-if-range)#switchport access vlan 2: Assign VLAN 2 to the interfaces.


Configuring a Trunk Port:

  1. Switch1>enable: Enter privileged EXEC mode.

  2. Switch1#configure terminal: Enter global configuration mode.

  3. Switch1(config)#interface FastEthernet 0/24: Specify the interface to configure.

  4. Switch1(config-if-range)#switchport mode trunk: Configure the interface as a trunk port.


Configuring EtherChannel:

  1. Switch1>enable: Enter privileged EXEC mode.

  2. Switch1#configure terminal: Enter global configuration mode.

  3. Switch1(config)#interface range FastEthernet0/11 -12: Specify a range of interfaces.

  4. Switch1(config-if-range)#switchport mode access: Configure the interfaces as access ports.

  5. Switch1(config-if-range)#switchport access vlan 10: Assign VLAN 10 to the interfaces.

  6. 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:

  1. Switch1>enable: Enter privileged EXEC mode.

  2. Switch1#configure terminal: Enter global configuration mode.

  3. Switch1(config)#spanning-tree mode rapid-pvst: Enable Rapid PVST.

  4. Switch1(config)#interface FastEthernet 0/2: Specify the interface to configure.

  5. Switch1(config-if)#spanning-tree portfast: Enable PortFast on the interface.


Enabling Routing:

  1. Router1>enable: Enter privileged EXEC mode.

  2. Router1#configure terminal: Enter global configuration mode.

  3. Router1(config)#ip routing: Enable IP routing.


Configuring a Static Route:

  1. Router1>enable: Enter privileged EXEC mode.

  2. Router1#configure terminal: Enter global configuration mode.

  3. 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:

  1. Router2>enable: Enter privileged EXEC mode.

  2. Router2#configure terminal: Enter global configuration mode.

  3. Router2(config)#ip routing: Enable IP routing.

  4. Router2(config)#router rip: Enable RIP.

  5. Router2(config-router)#version 2: Configure RIP version 2.

  6. Router2(config-router)#no auto-summary: Disable auto-summary.

  7. Router1(config-router)#network 192.168.5.0: Advertise the 192.168.5.0 network.

  8. Router2(config-router)#neighbor 192.168.1.1: Specify a neighbor for RIP.


Configuring EIGRP:

  1. Router2>enable: Enter privileged EXEC mode.

  2. Router2#configure terminal: Enter global configuration mode.

  3. Router2(config)#ip routing: Enable IP routing.

  4. Router2(config)#router eigrp 100: Enable EIGRP with AS number 100.

  5. Router2(config-router)#network 192.168.1.0: Advertise the 192.168.1.0 network.

  6. Router2(config-router)#network 192.168.5.0: Advertise the 192.168.5.0 network.

  7. Router2(config-router)#no auto-summary: Disable auto-summary.


Configuring OSPF:

  1. Router2>enable: Enter privileged EXEC mode.

  2. Router2#configure terminal: Enter global configuration mode.

  3. Router2(config)#interface loopback 0: Configure the loopback interface.

  4. Router2(config-if)#ip address 192.168.255.254 255.255.255.0: Assign an IP address to the loopback interface.

  5. Router2(config-if)#exit: Exit interface configuration mode.

  6. Router2(config)#router ospf 100: Enable OSPF with process ID 100.

  7. Router2(config-router)#network 192.168.255.254 0.0.0.0 area 0: Advertise the loopback network.

  8. Router2(config-router)#network 192.168.5.0 0.0.0.255 area 0: Advertise the 192.168.5.0 network.


Viewing Routing Information:

  1. Router2>enable: Enter privileged EXEC mode.

  2. Router2#show ip route: Display the IP routing table.


Configuring NAT:

  1. Router1>enable: Enter privileged EXEC mode.

  2. Router1#configure terminal: Enter global configuration mode.

  3. 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.

  4. Router1(config)#ip nat inside source list 1 interface FastEthernet 0/0 overload: Configure NAT overload on the FastEthernet 0/0 interface.

  5. Router1(config)#interface FastEthernet0/0: Specify the outside interface.

  6. Router1(config-if)#ip nat outside: Configure the interface as the outside interface.

  7. Router1(config-if)#interface FastEthernet0/1: Specify the inside interface.

  8. Router1(config-if)#ip nat inside: Configure the interface as the inside interface.


Configuring an ACL:

  1. Switch1>enable: Enter privileged EXEC mode.

  2. Switch1#configure terminal: Enter global configuration mode.

  3. **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

Feb 17

4 min read

0

6

0

Related Posts

Comments

Share Your ThoughtsBe the first to write a comment.
bottom of page