Router(config)# router ospf 1In this example, we are enabling OSPF process 1, setting the router ID to 192.168.1.1, and advertising the network 192.168.1.0/24 in OSPF area 0.
Router(config-router)# router-id 192.168.1.1
Router(config-router)# network 192.168.1.0 0.0.0.255 area 0
Router(config-router)# network 10.0.0.0 0.0.0.255 area 0Note that if you have multiple interfaces connected to the same network, you only need to advertise the network once. OSPF will automatically discover all interfaces connected to the same network.
show ip protocolsThese commands will display the current OSPF configuration, interface configuration, neighbor state, link-state database, and routing table, respectively. You can use these commands to troubleshoot OSPF configuration issues and ensure that OSPF is functioning correctly.
show ip ospf interface
show ip ospf neighbor
show ip ospf database
show ip route
Router(config)# router eigrp 100Specify the networks that will be advertised by EIGRP using the "network" command. For example, to advertise the network 192.168.1.0/24, use the following command:
Router(config-router)# network 192.168.1.0Adjust the EIGRP metric weights using the "metric weights" command. This allows you to adjust the importance of various factors in calculating the best path to a destination network. For example, to make delay the most important factor, use the following command:
Router(config-router)# metric weights 0 0 0 1 0 0Configure EIGRP authentication to secure your network using the "authentication" command. EIGRP supports several authentication methods, including MD5 authentication. For example, to use MD5 authentication with a key of "cisco", use the following commands:
Router(config)# key chain EIGRP_AUTH
Router(config-keychain)# key 1
Router(config-keychain-key)# key-string cisco
Router(config)# interface interface_name
Router(config-if)# ip authentication mode eigrp 100 md5
Router(config-if)# ip authentication key-chain eigrp 100 EIGRP_AUTH
Router# show ip protocolsThese are the basic steps to configure EIGRP on a Cisco IOS router. Depending on your network requirements, there may be additional configuration steps that you need to take.
Router# show ip eigrp neighbors
Router# show ip eigrp neighborsThe output of this command shows the IP addresses of the EIGRP neighbors, their interface, their hold time, and their state (whether they are in an established or non-established state).
Router# show ip eigrp topologyThe output of this command shows the destination network, the next hop router, the metric to the destination, and the outgoing interface.
Router# show ip route eigrpThe output of this command shows the destination network, the next hop router, the metric to the destination, and the outgoing interface.
Router# show ip eigrp interfacesThe output of this command shows the interface, the IP address of the interface, the state of the interface (whether it is up or down), and the metric weights that are being used for that interface.
Router# show ip eigrp statisticsThe output of this command shows information about the number of EIGRP packets sent and received, the number of EIGRP updates sent and received, and other statistics related to the operation of EIGRP on the router.
Router(config)#router ripIn this example, we enable RIPv2 by entering the router rip command. We then set the version to 2 using the version 2 command. We advertise the networks 10.0.0.0 and 192.168.1.0 using the network command. We configure authentication using the ip rip authentication key-chain command and specify the name of the key chain (MY_KEY_CHAIN). Finally, we exit the router configuration mode and save the configuration to the router's NVRAM using the copy running-config startup-config command.
Router(config-router)#ip rip authentication key-chain MY_KEY_CHAIN
Router#copy running-config startup-config
Router#show ip protocols
Routing Protocol is "rip"
Output delay 50 milliseconds between packets, minimum timeout 120 milliseconds
Maximum number of hops 15
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
Routing Information Sources:
Gateway Distance Last Update
192.168.1.1 120 00:01:42
Distance: (default is 120)
Router#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, FastEthernet0/0
R 192.168.1.0/24 [120/1] via 192.168.1.1, 00:02:35, FastEthernet0/0
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.0.0.0/24 is directly connected, FastEthernet1/0
R 10.0.1.0/24 [120/1] via 192.168.1.1, 00:02:35, FastEthernet0/0
Router#debug ip rip
RIP protocol debugging is on
traceroute 22.214.171.124Press Enter to run the command. The router will send packets to the destination IP address with increasing time-to-live (TTL) values, and record the IP addresses and response times of each device along the path.
Router#traceroute 126.96.36.199In this example, the router is tracing the route to 188.8.131.52, which is Google's DNS server. The output shows that the first hop is 192.168.1.1, which is the default gateway of the router. The second hop is 10.0.0.1, which is the next device on the network path. The third hop is 184.108.40.206, which is the first device outside of the local network. The fourth hop is 220.127.116.11, which is another device on the network path. The fifth and final hop is 18.104.22.168, which is the destination IP address. The output also shows the response times for each device along the path.
Type escape sequence to abort.
Tracing the route to 22.214.171.124
1 192.168.1.1 8 msec 8 msec 8 msec
2 10.0.0.1 16 msec 16 msec 16 msec
3 126.96.36.199 24 msec 24 msec 24 msec
4 188.8.131.52 28 msec 28 msec 28 msec
5 184.108.40.206 32 msec 32 msec 32 msec
Router(config)# interface <interface>Enable TFTP server on the router and specify the directory where the files will be stored:
Router(config-if)# ip address <ip-address> <subnet-mask>
Router(config-if)# no shutdown
Router(config)# ip tftp source-interface <interface>Optionally, set a timeout value for the TFTP server:
Router(config)# ip tftp path flash:<directory>
Router(config)# ip tftp timeout <timeout-value>Copy the file you want to transfer to the TFTP server directory:
Router# copy <file> flash:<directory>Start the TFTP server:
Router# tftp-server flash:<directory>/<file>Verify that the TFTP server is running and that the file is available:
Router# show ip tftpOnce the TFTP server is running, you can use a TFTP client on another device to transfer files to or from the router. For example, to transfer a file from the TFTP server to another device, you could use the following command on the other device:
Router# show flash:<directory>
copy tftp://<ip-address>/<file> <destination>Where <ip-address> is the IP address of the TFTP server (the router), <file> is the name of the file you want to transfer, and <destination> is the path where you want to save the file on the other device.
<IP address> <hostname>For example:
192.168.1.10 myserver.example.comThis entry would map the hostname myserver.example.com to the IP address 192.168.1.10. When a device on the network wants to communicate with myserver.example.com, it would look up the hostname in its local host table, and then use the corresponding IP address to establish a connection.
Router# show hostsIn this example, the show hosts command displays a list of three entries in the host table, each with a corresponding IP address and MAC address (in the format of XX:XX:XX:XX:XX:XX), along with their status (valid, permanent entries in this case). The V in the Status field indicates that the entry is currently valid.
Default domain is not set
Name/address lookup uses static mappings
Codes: UN - unknown, EX - expired, OK - OK, ?? - revalidate
temp - temporary, perm - permanent
NA - Not Applicable, V - Valid, I - Invalid, s - seconds
mins - minutes, h - hours, d - days, expires never
192.168.1.10 00:0c:29:9f:7d:1c V perm
192.168.1.20 00:0c:29:87:75:7b V perm
192.168.1.30 00:0c:29:7b:2f:db V perm
Router(config)# hostname Router1Generate RSA keys for secure communication using the crypto key generate rsa command:
Router1(config)# line vty 0 4Set a password for telnet access using the password command:
Router1(config-line)# password mypasswordSet the login authentication method to local using the login local command:
Router1(config-line)# login localEnable telnet access using the transport input telnet command:
Router1(config-line)# transport input telnetExit configuration mode using the exit command.
telnet 192.168.1.1 0You will be prompted to enter the password that you set in step 4. Once you have successfully authenticated, you will be able to interact with the router's CLI.
Router(config)# ip dhcp snoopingConfigure the interfaces on which DAI will be enabled. Use the following command to enable DAI on an interface:
Router(config-if)# ip arp inspection trustThis command tells the router to trust ARP packets that are received on this interface.
Router(config)# ip arp inspection vlan <vlan-id>This command tells the router to inspect ARP packets for the specified VLAN.
Router(config-if)# ip arp inspection limit rate <packets-per-second>This command limits the rate of ARP packets that can be received on an interface, which helps to prevent ARP flooding attacks.