CISCO Router Commands

From KlavoWiki
Revision as of 06:06, 12 February 2017 by David (talk | contribs) (→‎IP Settings)
Jump to navigationJump to search

IP Settings

enable
configure terminal
!
interface fa0/0
ip address 192.168.1.200 255.255.255.0
no shutdown
exit
!
interface fa1/0
ip address 172.16.1.254 255.255.255.0
no shutdown
exit

IPv6

enable
configure terminal
!
ipv6 unicast-routing
!
interface FastEthernet 0/0
ipv6 address 001:db8:0:1::1/64
no shutdown
exit

IPv6 Routing

ipv6 route ::/0 FastEthernet 1/0

IPv6 General Commands

When using IPv6 the same commands can be used when using IPv4. Ths ip command is changed to ipv6.

enable
!
show ipv6 interface FastEtherenet 0/0
show ipv6 interface brief
!
configure terminal
!
interface FastEthernet 1/0
ipv6 ospf 1 area 0
!
interface FastEthernet 6/0
ipv6 address fe80::1 link-local
no shutdown
exit
!
ipv6 route 2001:db8:0:1::1/64 FastEthernet 0/0 10


Multiple VLAN Single Interface

enable
configure terminal
!
interface FastEthernet 0/0
no shutdown
!
interface FastEthernet 0/0.10
encapsulation dot1Q 10
ip address 192.168.1.254 255.255.255.0
!
interface FastEthernet 0/0.20
encapsulation dot1Q 20
ip address 192.168.2.254 255.255.255.0
!
interface FastEthernet 0/0.30
encapsulation dot1Q 30
ip address 192.168.3.254 255.255.255.0
!
exit

Show

enable
!
show ip interface brief
!
show interfaces
show interfaces FastEthernet 0/0
show interfaces Port-channel 1

Loopback

Create

enable
configure terminal
!
interface loopback 1
ip address 172.18.101.9 255.255.255.255
exit
!
interface loopback 2
ip address 10.77.101.5 255.255.254.0
exit

Delete

enable
configure terminal
!
no interface loopback 2
exit

DHCP

enable
configure terminal
!
ip dhcp pool Sales
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
dns-server 8.8.8.8
lease h m s
exit
!
ip dhcp pool Admin
network 192.168.20.0 255.255.255.0
default-router 192.168.20.1
exit

Show

enable
!
show ip dhcp binding
show ip dhcp conflict
show ip dhcp relay
!
show dhcp lease

Relay

enable
configure terminal
!
ip helper-address x.x.x.x

Routes

Default

enable
configure terminal
!
ip route 0.0.0.0 0.0.0.0 FastEthernet 0/0

Static

enable
configure terminal
!
ip route 192.168.22.0 255.255.255.0 FastEthernet 0/0 20
ip route 172.30.11.0 255.255.255.0 FastEthernet 0/3 10

Automatic

OSPF

Advertising

Advertise each subnet to be distributed. The subnet needs to exist on the router for the route to be distributed.

router ospf 1
network 192.168.1.0 0.0.0.255 area 0
network 172.16.12.0 0.0.3.255 area 0

Exclude

Exclude an interface from OSPF broadcasts

enable
configure terminal
!
router ospf
passive-interface FastEthernet 0/0

OSPF Static Routes

To distribute static routes. Needs to be completed on each router that has a static route that needs to be part of OSPF.

enable
configure terminal
!
router ospf 1
redistribute static subnets

Hello Interval

All routers must be set the same. Defaults as below.

enable
configure terminal
!
interface FastEthernet 0/0
ip ospf hello-interval 5
ip ospf dead-interval 40

Show

enable
!
show ip ospf interface
show ip ospf database
show ip ospf neighbor
show ip protocols
show ip ospf interface FastEthernet 3/0

BGP

As the AS number is the same for local and remote it is concidered iBGP. Making the local and remote AS number different make it eBGP.

Router 1

enable
configure terminal
!
router bgp 1001
neighbor 192.51.100.2 remote-as 1001
exit

Router 2

enable
configure terminal
!
router bgp 1001
neighbor 198.51.100.1 remote-as 1001

Show

enable
!
show ip bgp neighbors
show ip bgp summary

RIP

The no auto-summary allows subprefix routing information to pass across classful network boundaries.

enable
configure terminal
!
router rip
version 2
no auto-summary
network 192.168.1.0
network 172.30.24.0

Exclude Interface

Disable RIP broadcasts from a particular interface.

enable
configure terminal
!
router rip
passive-interface FastEthernet 3/0

Show

show ip rip database

EIGRP

enable
configure terminal
!
router eigrp 1
no auto summary
network 192.168.10.0 0.0.0.255
network 192.168.20.0 0.0.0.255
network 10.1.1.0 0.0.0.3
!
passive-interface fa0/0

Redistribute Static Routes

enable
configure terminal
!
router eigrp 1
redistribute static
exit

Show

show ip eigrp neighbors
show ip eigrp topology
show ip route

Disable Domain Lookup

no ip domain lookup