CISCO vs Juniper – Comparing 10 Common Network Commands

Introduction

Are you a CISCO or Juniper person? Have you ever wondered what certain commands look like in CISCO’s IOS, or in Juniper’s Junos? This article covers 10 common network engineering commands and compares the CISCO vs Juniper version.

Tasks

1. Change Host-Name

Every device has a device name or hostname. This is an easy way to know which device you are currently logged into. Most network administrators give their network devices hostnames that describe what device it is and what it does. Think of a core router located at your main office, you could use a hostname like “CORE-RTR-HQ”. The more descriptive the name, the better.

CISCO

Router(config)# hostname CORE-RTR-HQ
CORE-RTR-HQ(config)#

Note how the prompt changes from “Router” to “CORE-RTR-HQ” which is the new hostname.

Juniper

root@# set host-name CORE-RTR-HQ
root@CORE-RTR-HQ#

2. Create VLAN

A VLAN (Virtual Local Area Network) is a logical separation that creates a boundary for your traffic on the LAN. It helps you separate your traffic and reduce the size of your broadcast domain. Each VLAN can be thought of as a separate network or subnetwork. Traffic between VLAN’s needs a router or routing device to communicate between VLAN’s.

CISCO

CORE-RTR-HQ(config)# vlan 20
CORE-RTR-HQ(config)# name sales

Juniper

root@CORE-RTR-HQ# set vlans sales
root@CORE-RTR-HQ# set vlans sales vlan-id 20

3. Create SVI (Switch Virtual Interface)

An SVI (Switch Virtual Interface) is an interface created on a switch to act as a logical Layer 3 (Routing) interface. An SVI is then given a Layer 3 IP address to allow for routing on that switch. SVI’s are useful for remote management of switches because they let you reach the switch remotely using an IP address. SVI’s also allow for other routing functions on switches.

Most importantly, SVI’s let you route traffic from one VLAN to another.

CISCO

Switch1(config)# ip routing
Switch1(config)# interface vlan 30
Switch1(config-if)# ip address 192.168.30.254 255.255.255.0

Juniper

root@Switch1# set vlans MARKETING
root@Switch1# set vlans MARKETING vlan-id 30
root@Switch1# set interfaces vlan unit 30 family inet address 192.168.1.1/24
root@Switch1# set vlans MARKETING l3-interface vlan.30

The third Junos command will configure an RVI (Router VLAN Interface) for the specified VLAN. Note that an RVI is the Juniper equivalent of an SVI in CISCO. Also, take note of the unit value (units are used for logical interface configuration), we have made it the same as our VLAN ID.

The fourth command will link the RVI to the specific VLAN using the unit number.

4. Configure Multiple (Range) Ports

There are times when you need to make a change to more than one port on your device. Instead of having to make the same change over and over again, network devices let you change multiple ports at once. This is very useful if you want to change the VLAN of multiple ports for example.

CISCO

Switch1(config)# interface range GigabitEthernet 0/3 – 4
Switch1(config-if-range)# switchport mode access

Notice the change in the prompt. It now reads “config-if-range”. This tells you that you are currently configuring more than 1 port at the same time.

Juniper

root@Switch1# set interface interface-range SCOPE member-range ge-0/0/0 to ge-0/0/3

5. Configure SSH

SSH or Secure Shell is a remote administration protocol that allows you to connect to your network devices securely. Unlike Telnet (clear text) SSH encrypts all the data sent across the network making it secure.

Enabling SSH on a CISCO router is a multi-step process. On a Juniper device, you can enable SSH with a single command. 

CISCO

Switch1(config)# ip domain-name mynetworknexus.com
Switch1(config)# crypto key generate rsa
Switch1(config)# ip ssh version 2
Switch1(config)# line vty 0 4
Switch1(config-line)# transport input ssh
Switch1(config-line)# login local

All the steps listed above are needed to enabled SSH on a CISCO router. For more explanations of what each command does check out my full article on setting up SSH on your CISCO device.

Juniper

root@Switch1# set system services ssh

6. Configure Static Route

A static route is one that is manually configured by you to let the Router know how to get to a particular destination network. Static Routes are mostly used in smaller networks that need only a few routes. In many cases, you will use a static route to set up a default route, also known as a Gateway of Last Resort.

CISCO

CORE-RTR-HQ(config)# ip route 192.168.20.0 255.255.255.0 192.168.10.2

Juniper

root@CORE-RTR-HQ# set routing-options static route 192.168.20.0/24 next-hop 192.168.10.2

7. Configure RIP

Routing Information Protocol (RIP) is a distance-vector protocol. This means it uses the distance from the source to destination to make routing decisions. The distance to the destination is determined by the number of hops from source to destination. RIP is a simple protocol that is still used in many networks today (mostly for internal routing).

CISCO

CORE-RTR-HQ(config)# router rip
CORE-RTR-HQ(config)# network 192.168.12.0
CORE-RTR-HQ(config)# network 172.16.1.0

First, we activate or enable the RIP process. Then we set the network that RIP will create and exchange routing information for using the “network” command. The networks specified are the ones connected to the RIP Neighbours.

Juniper

[edit protocols]
root@CORE-RTR-HQ# set rip group myripgroup-group neighbor fe-0/0/1.0
root@CORE-RTR-HQ# set rip receive version-2 
root@CORE-RTR-HQ# set rip send version-2

RIP version 2 neighbors need to belong to the same group. We do this by adding the interfaces facing neighbors in the same group. In this case, our group is called “myripgroup” and our interface is placed in it.

Note that this particular interface already has other configurations applied to it, like IP addresses etc.

8. Configure Default Route

For any network traffic to be routed from source to destination, there must be a route to that destination. If a router does not find a routing entry for a specific destination, it looks for the default route. This route is basically the last option the router has when it does not know where to send the traffic.

Most default routes are manually configured as a static route and are pointed to the gateway device of the network (mostly to your ISP).

CISCO

CORE-RTR-HQ(config)# ip route 0.0.0.0  0.0.0.0 ge 0/0/0

A source network of all zero’s (0.0.0.0) and destination of all zero’s means the route will affect traffic from any source going to any destination (in this case, unknown destination).

Juniper

root@CORE-RTR-HQ# set routing-options static route 0.0.0.0/0 next-hop 123.123.123.123

In a similar way, the default route is determined by the source network of all zero’s (0.0.0.0/0).

9. Save Changes Permanently

Saving the changes you have made to your device is a key step. This ensures that your changes will not be lost when the device restarts. Basically your changes are made permanent by copying them to permanent memory.

CISCO

CORE-RTR-HQ(config)# copy running-configuration startup-configuration
OR
CORE-RTR-HQ(config)# write

Juniper

root@CORE-RTR-HQ# commit

10. Configure DHCP

DHCP (Dynamic Host Configuration Protocol) is an important part of any network. It lets you (the network engineer) define a way to give out IP addresses on your network automatically. The protocol also lets you manage how many users can connect to your network and how long they can keep an IP address.

DHCP allows you to give each host important information about your network, like the domain name and DNS server.

CISCO

CORE-RTR-HQ(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.99
CORE-RTR-HQ(config)# ip dhcp pool myNetworkNexusDHCP
CORE-RTR-HQ(config)# network 192.168.1.0 255.255.255.0
CORE-RTR-HQ(config)# domain-name mynetworknexus.com
CORE-RTR-HQ(config)# default-router 192.168.1.1
CORE-RTR-HQ(config)# dns-server 192.168.1.1

We start off by defining excluded addresses (address range) that should not be given out by the DHCP server. Then we create a DHCP poll and call it “myNetworkNexusDHCP”. After that, we configure the network address for the DHCP service.

The next step see’s us define the networks default gateway and then lastly we configure the DNS server.

Juniper

root@CORE-RTR-HQ# set system services dhcp pool 192.168.1.0/24 address-range low 192.168.1.100
root@CORE-RTR-HQ# set system services dhcp pool 192.168.1.0/24 address-range high 192.168.1.150
root@CORE-RTR-HQ# set system services dhcp pool 192.168.1.0/24 domain-name nynetworknexus.com
root@CORE-RTR-HQ# set system services dhcp pool 192.168.1.0/24 name-server 192.168.1.1
root@CORE-RTR-HQ# set system services dhcp pool 192.168.1.0/24 router 192.168.1.1
root@CORE-RTR-HQ# set system services dhcp pool 192.168.1.0/24 default-lease-time 3600
root@CORE-RTR-HQ# set security zones security-zone untrust interfaces fe-0/0/5.0 host-inbound-traffic system-services dhcp

First, we set the IP address lease range by setting a lower, then upper limit. These limits represent the first and last IP address given out by DHCP. in our case the first IP address given is 192.168.1.100 and the last possible address to be given is 192.168.1.150.

Next we set the domain name that will be given to machines that join our network. After that we define the DNS server IP address and the default gateway for our network. Next, we tell the DHCP server how long each user will have the issued IP address. This lease time is given in seconds (3,600 seconds in our case)

Lastly, we associate interfaces connecting the LAN, to the DHCP configuration. This allows them to exchange DHCP discovery messages.

Conclusion

For a network engineer, the choice of vendor or routing platform may not be the biggest of issues. Personally, I have worked with CISCO, Sophos, Endian, etc. Normally engineers start working with one vendor and get really comfortable with them. Some love to experiment and play around with many different brands.

It’s fun sometimes to see how things are on the other side. If you ever had to make a transition from one side of the fence to the other, the commands above give you a feel of what it would be like. Hope you enjoyed it…


william_mweemba_bio

About The Author

William is a Network Engineer working in the Financial Sector as an Infrastructure and Network Administrator. Passionate about technology, he also runs a company providing a range of tech services for small, medium, and large organizations. William leverages 9 years of experience in the tech industry and has a passion for entrepreneurship with the goal of providing quality products and services to his customers. He also believes in sharing knowledge to grow the industry and help others. He maintains a blog as well as publishes ebooks to share what he has learned in his life and career. William Holds a Bachelors Degree in Computer Science (BSc) and a Huawei HCIA Certification in Routing and Switching.

2 thoughts on “CISCO vs Juniper – Comparing 10 Common Network Commands

Comments are closed.