Cisco IOS & Commands - caitlinmallen/TechWiki GitHub Wiki
Cisco IOS & Commands
Configuring Different Settings
About Cisco
About Cisco
What is Cisco IOS?
- Cisco Internetworking Operating System
- Now used on most Cisco switches and routers
- Some Cisco security appliances use a Linux-derived OS instead of Ciscso IOS
Cisco IOS Config File
Cisco IOS configurations are thought of as one big file
- When entering a configuration command, you are essentially editing the file by adding, removing, or editing lines
- Essentially two versions of the configuration file
- Starup-config
- Last version of what was saved. If the router/switch is restarted, these configurations would still load.
- Running-config
- Stored in memory and is not saved after power down.
- To save running-config permanently there are two options:
- copy running-config startup-config
- copy run start\
- Starup-config
CIOS Command Modes There are different "levels" of command and configuration options
- User EXEC Mode
- Basic monitoring and status commands
- Would see 'Router>' displayed
- Privileged EXEC Mode
- Admin/root access
- Would see 'Router>#' displayed
- Global Config Mode
- Device-wide configuration settings
- Would see 'Router(config)#' displayed
- Interface Config Mode
- Configure interface settings
- Would see 'Router(config-if)#' displayed\
Cisco IOS Helpful Tips
- Up arrow displays last entered commands
- Type '?' in current mode to see all options you can type or complete an existing command
- TAB autocompletes
Configuring Different Settings
Configuring Switchports
- Access Ports
- configure - terminal
- (configure-if)#interface [port_name-number]
- (configure-if)#switchport mode access
- (configure-if)#switchport access vlan [vlan-id#]
- Trunk Ports
- configure - terminal
- (configure-if)#interface [port_name-number]
- (configure-if)#switchport mode trunk
- (configure-if)#switchport trunk allowed vlan [vlan-range]
DHCP
- ip helper-address is important to remember
- When assigning the IP helper address, use the eth0 interface IP of the DHCP server, that is the server address *(config)# interface vlan [vlan_id#] *(config-if)# ip helper-address [DHCPServer_Address]
NAT
- Multi Step Process
- Routing needs to be configured before NAT can be configured
- enable
- configure terminal
- hostname [Hostname]
- interface [interface being chosen, ex. fastEthernet 0/0]
- ip adress [interface gateway address, ex. 30.0.0.1] [netmask, ex. 255.0.0.0]
- no shutdown
- exit
- Define the inside and outside interfaces
- Inside is the interface connected to the private address, outside connected to the public address
- interface fastEthernet 0/0
- ip nat inside
- exit
- #interface serial 0/0/0
- (config-if)# ip nat outside
- exit
- Set NAT Rules
- Static Mappings
- ip nat inside source static [private ip] [public ip]
- interfaces [inside interface]
- exit
- interface [outside interface]
- ip nat outside
- exit
- exit
- For PAT
- ip nat pool [pool name] [pool address] [pool address] netmask [netmask]
- access-list [ACL ID] permit [source address] [netmask]
- ip nat inside source list [ACL ID] pool [pool name] overload
- exit
- show ip nat translations
OSPF
- Configure network (if applicable)
- Check subnets
- Assign IPs
- Assign proper gateways to routers, if multiple, increase last octet by 1 to make sure packets can flow between routers and to machines
- Check machines to make sure they have proper gateways
- Enable interfaces on routers
- Get wildcard masks of subnets
- Google it or check Wiki for how to do that if Adam says no Google :/
- Configure OSPF on routers
- Enter the Cisco IOS command line
- enable > router ospf [instance_number] (Just put 1 for ease)
- Network [network_address] [wildcard_mask] area 0
- Do this on all routers for each subnet they are on
- Make sure machines can ping
- Enter back into routers to define a keychain
- enable > configure terminal
- key chain [name]
- key [key-id]
- key-string [name]
- cryptographic-algorithm [algorithm]
- send-lifetime [start-time] { infinite | end-time | duration seconds}
- Now we need to define authentication
- interface [type] [number]
- ip ospf authentication key-chain [name]
BGP
- Define router instance
- router bgp AS_Number_for_Router
- router bgp 1010
- Identify peers
- (config-router) neighbor ip_of_peer remote-as as-number_of_peer
- (config-router) neighbor 192.168.1.2remote-as 2352
- Advertise Networks
- (config-router) network 10.10.52.0mask 255.255.255.0
- If configuring redistribution of OSPF on border router
- To advertise networks shared through OSPF, the following command needs to be included in the BGP configuration
- redistribution ospf instance_number
Standard ACL
- R2(config)#ip access-list standard STND-1
- R2(config-std-nacl)#deny 192.168.11.0 0.0.0.255
- R2(config-std-nacl)#permit any
- R2(config-std-nacl)#interface Serial0/0/0
- R2(config-if)#ip access-group STND-1 in