# CCNA Basic
###### tags: `network`
[TOC]
# Download Packet Tracer

You need to download **Packet Tracer** to use this tutorial.
# Router Commands explanation
## **enable** Command
This let's us go from **User Mode** to **Priviledge Mode**.
```=
Router> enable
Router#
```
>**Note:**
>We can assure that we changed the mode by checking **>** to **#**.[color=orange]
## **configure terminal** Command
We use this one to enter config mode, or else we will not be able to change any configurations.
If you cannot use it, double check whether you are in user mode or priviledge one.
```=
Router#configure terminal
Router(config)#
```
>**Note:**
>We can assure that we can change configurations by seeing **(config)**.[color=orange]
## **hostname inputname** Command
Being in **priviledge mode** and **config mode** (configure terminal command to enter this mode), we can rename our router.
```=
Router(config)#hostname R1
R1(config)#
```
>**Note:**
>We can assure that we can change name, when we see that **Router** turned into another name.
>In this case **R1** as our new new for that Router.[color=orange]
## **show ip interface brief** Command
First of all, **interface** means ports.
By being in **priviledge mode**, we can use this command **show ip interface brief** to see which ports/interfaces are available as shown below.
> [color=orange]
We will see **FastEthernet** and **Vlan** types. FastEthernet is a physical port while Vlan is virtual one.
## **interface fastEthernet 0/0**
Being in **Priviledge Mode** and **configuration mode**, we can enter to specific port in Router by using this command **interface port**.
**How do we know the port/interface we can use?**
Remember we can use **show ip interface brief** in priviledge mode.
>[color=lightblue]
>**Note:**
>We can assure that we got into the port we wanted, by checking that **(config)** changed into **(config-if)**[color=orange]
## **ip address default-gateway subnetmask** Command
By being in **priviledge mode** > **configuration mode** > **specific port/interface**, we can change the port IP.
**How we know if we can run this command or not?**
Just check where you are! check if you have **(config-if)** as shown below.
```=
R1>enable
R1#configure terminal
R1(config)#interface FastEthernet0/0
R1(config-if)#ip address 192.168.10.254 255.255.255.0
```
### **How do we know which default-gateway(IP) we have to use?**
Just checkout the PC that is being linked with!
As shown in the image below, if the Router port 0/0 is being connected to **PC0 (192.168.10.1)** && **PC6 (192.168.10.2)**, then we know that the default gateway for this port will be **192.168.10.254**.
While for the Port 0/1 connected to **PC1 (192.168.20.1)**, then in this case port 0/1's IP should be **192.168.20.254**.
>[color=orange]
### **How do we know which subnetmask we have to use?**
What is **subnetmask**?
This only tells us how many IPs are available for use.
>We can know which subnetmask is, by checking the number after **slash (/)**. [color=lightgreen]
>
>**/24**
>11111111.11111111.11111111.00000000
>255.255.255.0
>
>**/25**
>11111111.11111111.11111111.10000000
>255.255.255.128
### How do we check whether the IP(Gateway) in Router was set up correctly?
We can use **ping ip** command in PC's command terminal to check whether it was set correctly or not.
First of all, let's say that we are in **PC0** and we need to ping **PC1**, the only way to get there is by passing through Router.
Therefore, we use **ping 192.168.20.1**, if it does not give timeout, means it was set correctly.
>[color=orange]
## ? Command
We can check which commands are available in specific mode.
```=
R1>?
Exec commands:
<1-99> Session number to resume
connect Open a terminal connection
disable Turn off privileged commands
disconnect Disconnect an existing network connection
enable Turn on privileged commands
exit Exit from the EXEC
logout Exit from the EXEC
ping Send echo messages
resume Resume an active network connection
show Show running system information
ssh Open a secure shell client connection
telnet Open a telnet connection
terminal Set terminal line parameters
traceroute Trace route to destination
R1>enable
R1#?
Exec commands:
<1-99> Session number to resume
auto Exec level Automation
clear Reset functions
clock Manage the system clock
configure Enter configuration mode
connect Open a terminal connection
copy Copy from one file to another
... etc
```
## line vty Command (Priviledge management Command)

**Note:**
By using **no login** we are stating that no password needed and **privilege level 15** means it has the highest authority available.
## How to save all commands?
First we have to say, all commands done will not automatically save as they are in RAM memory. It will be reset if nothing is done when restarting the machine. Therefore, **saving step is needed.** All saving will be done in NVRAM.
We can save all steps by running:
```=
R1#copy running-config startup-config
```
or
```=
R1#write
```
**How to check whether it is saved or not?**
We can show the startup-config to check up all actions saved.
# Switch Commands explanation
Most commands are same as Router.
