Basic configuration

Okapi > General purpose > Basic Configuration

 

Introduction

 

A router is a networking device whose software and hardware are usually tailored to the tasks of routing and forwarding information. Routers connect two or more logical subnets, which do not necessarily map one-to-one to the physical interfaces of the router.

This tutorial will show step by step instructions to configure a basic router.

 

Network Diagram

Configuration

 

Setting enable mode(priveledge exec) password

Log in as router user, default is view mode.


Command 
Present Mode
Purpose
Okapi>View Mode
Default mode on log in
Okapi> enableView Mode
Switch to Enable mode
Okapi# configure terminalEnable ModeSwitch to Global Configuration Mode
Okapi(config)# enable password mypassword Global Configuration Mode Set Enable Mode password
Okapi(config)# exit
Global Configuration Mode
Switch to enable mode

Okapi# disable

Enable Mode
Switch to view mode

Okapi> enable

Enter Enable Password:

View Mode
Switch to Enable Mode with authentication


Show running configuration and copy running configuration to startup configuration

We save the configuration to make it persistent  across reboots.

Log in as router user, default is view mode.

Command Present Mode
Purpose
Okapi>View Mode
Default mode on log in
Okapi> enableView Mode
Switch to Enable mode
Okapi# show running-configuration zebra
Enable ModeDisplays current running configuration

Okapi# write

Enable Mode
Copy running configuration to startup configuration


Assign IP address to an interface and setting a default route

The router R1 is having two ethernet interface, Fastethernet0 is in the private network and Fastethernet1 is towards the internet, we are assigning IP address 192.168.1.2 to Fastethernet0 and 112.1.1.1 to Fastethernet1.

Command 
Present Mode
Purpose
Okapi>View Mode
Default mode on log in
Okapi> enableView Mode
Switch to Enable mode
Okapi# show interface Enable Mode
Shows the list of available interfaces
Okapi# configure terminal
Enable Mode
Switch to Global Configuration Mode
Okapi(config)# interface fastethernet 0
Global Configuration Mode
Switch to Fastethernet configuration Mode

Okapi(config-if-eth)# ip address 192.168.1.2/16

Interface Fastethernet Configuration Mode
Assign ip address to the interface
Okapi(config-if-eth)# exit Interface Fastethernet Configuration ModeExit to global configuration mode
Okapi(config)# interface fastethernet 1 Global Configuration Mode Switch to Fastethernet configuration Mode

Okapi(config-if-eth)# ip address 112.1.1.1/16

Interface Fastethernet Configuration Mode
Assign ip address to the interface
Okapi(config-if-eth)# exit 
Interface Fastethernet Configuration Mode
Exit to global configuration mode
Okapi(config)# ip route 0.0.0.0/0 Fastethernet 1
Global Configuration Mode
Setting up a default route, so that all the traffic whose destnation is not known gets forwarded to Fastethernet 1

 

Configure basic firewall and NAT

Once IP addresses and default route is set, we are configuring NAT to provide internet access to all the hosts in private network and a simple firewall on the traffic coming from private network.We are also saving the configuration to make it persistent on reboot.

Command 
Present Mode
Purpose
Okapi>View Mode
Default mode on log in
Okapi> enableView Mode
Switch to Enable mode
Okapi# configure terminal
Enable Mode
Switch to Global Configuration Mode
Okapi(config)# access-list 10 permit 192.168.1.0 0.0.0.255 Global Configuration Mode
Configure an access-list which will permit traffic whose source address matches 192.168.1.0/24
Okapi(config)# interface fastethernet 0 
Global Configuration Mode 
Switch to Fastethernet configuration Mode

Okapi(config-if-eth)# ip access-group 10 in

Interface Fastethernet Configuration Mode
Applying filter on inbound traffic on interface
Okapi(config-if-eth)# exitInterface Fastethernet Configuration ModeExit to global configuration mode
Okapi(config)# ip nat inside source list 10 interface FastEthernet 1Global Configuration ModeConfigure source NAT for all the traffic matching source list 10 going out on fastethernet 1.
Okapi(config)# do write
Global Configuration ModeCopy the running configuration to startup configuration to make it persistent on reboot.

 

This will get you familiar with Okapi Command Line Interface, advanced configuration of various protocols, services and can be found at folowing links: