# Network configuration

##### **Start basic configuration**

 **ข้อมูลเบื้องต้นเกี่ยวกับ Switch CISCO**

<table border="1" class="align-left" id="bkmrk-parameter-default-va" style="border-collapse: collapse; width: 43.9506%; height: 116px;"><tbody><tr style="height: 29px;"><td class="align-left" style="width: 33.3333%; height: 29px;">Parameter</td><td class="align-left" style="width: 33.3333%; height: 29px;">Default value</td></tr><tr style="height: 29px;"><td class="align-left" style="width: 33.3333%; height: 29px;">Username</td><td class="align-left" style="width: 33.3333%; height: 29px;">cisco</td></tr><tr style="height: 29px;"><td class="align-left" style="width: 33.3333%; height: 29px;">Password</td><td class="align-left" style="width: 33.3333%; height: 29px;">cisco</td></tr><tr style="height: 29px;"><td class="align-left" style="width: 33.3333%; height: 29px;">Lan IP</td><td class="align-left" style="width: 33.3333%; height: 29px;">192.168.1.254</td></tr></tbody></table>

- Step 1 เชื่อมต่อสาย Lan เข้ากับ switch พอร์ตใดพอร์ตหนึ่ง
- Step 2 Setup IP address บนเครื่องคอมพิวเตอร์ให้อยู่ในระหว่าง 192.168.1.2 ถึง 1192.168.1.253
- Step 3 ทดสอบ ping ไปยังอุปกรณ์ Switch IP : 192.168.1.254
- Step 4 เปิดใช้งาน Web browser บนเครื่อง และพิมพ์เข้าเว็บไซต์ http://192.168.1.254 จะขึ้นหน้าต่างดังนี้

[![image-1671681545417.png](https://bookstack.wu.ac.th/uploads/images/gallery/2022-12/scaled-1680-/image-1671681545417.png)](https://bookstack.wu.ac.th/uploads/images/gallery/2022-12/image-1671681545417.png)

- Step 5 ใส่ Default Username คือ cisco และ Defualt Password คือ cisco หลังจากนั้นคลิก Login
- Step 6 สร้าง User สำหรับ Access อุปกรณ์ และเลือก User Level   
     โดยเข้าไปที่ Administration -&gt; เลือก User Accounts -&gt; Add

[![image-1671690238354.png](https://bookstack.wu.ac.th/uploads/images/gallery/2022-12/scaled-1680-/image-1671690238354.png)](https://bookstack.wu.ac.th/uploads/images/gallery/2022-12/image-1671690238354.png)

- Step 7 เมื่อกดเลือก Add จะมีหน้าต่างสำหรับสร้าง User จากนั้นกรอกข้อมูลให้ครบถ้วน และกด Apply

[![image-1671690575299.png](https://bookstack.wu.ac.th/uploads/images/gallery/2022-12/scaled-1680-/image-1671690575299.png)](https://bookstack.wu.ac.th/uploads/images/gallery/2022-12/image-1671690575299.png)

- Step 8 จากนั้นให้ทำการ Enable เปิด Service SSH Service   
     โดยไปที่ Security -&gt; เลืือก TCP/UDP Services -&gt; ติ๊กที่ Enable หัวข้อ SSH Service และ กด Apply

[![image-1671690959316.png](https://bookstack.wu.ac.th/uploads/images/gallery/2022-12/scaled-1680-/image-1671690959316.png)](https://bookstack.wu.ac.th/uploads/images/gallery/2022-12/image-1671690959316.png)

---

##### **Basic network configuration**

- Step 1 เชื่อมต่อ COM port เข้ากับ PC และ command ผ่านสาย console ของอุปกรณ์ Switch
- Step 2 Run โปรแกรม terminal สำหรับการเชื่อมต่อการสื่อสาร  
    ตั้งค่า parameter   
     - Baud rate: 9600 bps  
     - Data bit: 8  
     - Stop bit: 1  
     - Parity: none  
     - Flow control: none
- Step 3 Config MGMT IP address

```Python
<Hostname># configure terminal
<Hostname>(config)# hostname NAME
<Hostname>(config)# vlan 10
<Hostname>(config)# interface vlan 10
<Hostname>(config-if)# interface vlan 10
<Hostname>(config-if)# ip address 10.10.1.2 /24
<Hostname>(config-if)# name Lab-test mgmt
<Hostname>(config-if)# exit
<Hostname>(config)# ip default-gateway 10.10.1.1
<Hostname>(config)# interface GigabitEthernet 1/0/24
<Hostname>(config-if)# switchport mode trunk
<Hostname>(config-if)# switchport trunk allowed vlan 10
<Hostname>(config-if)# exit
```

- Step 4 Verify configuration

```Python
<Hostname># show running-config

OR

<Hostname>(config)# do show running-config
```