Why?


Search This Blog

Saturday, February 27, 2016

CentOS 7 install Nagios



CentOS 7 install Nagios

This is from https://www.digitalocean.com/community/tutorials/how-to-install-nagios-4-and-monitor-your-servers-on-centos-7

Prerequisites

To follow this tutorial, you must have superuser privileges on the CentOS 7 server that will run Nagios. Ideally, you will be using a non-root user with superuser privileges. If you need help setting that up, follow the steps 1 through 3 in this tutorial: Initial Server Setup with CentOS 7.
A LAMP stack is also required. Follow this tutorial if you need to set that up: How To Install LAMP stack On CentOS 7.

This tutorial assumes that your server has private networking enabled. If it doesn't, just replace all the references to private IP addresses with public IP addresses.
Now that we have the prerequisites sorted out, let's move on to getting Nagios 4 installed.

Install Nagios 4

This section will cover how to install Nagios 4 on your monitoring server. You only need to complete this section once.

Install Build Dependencies

Because we are building Nagios Core from source, we must install a few development libraries that will allow us to complete the build.
First, install the required packages:
sudo yum install gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel xinetd unzip

Create Nagios User and Group

We must create a user and group that will run the Nagios process. Create a "nagios" user and "nagcmd" group, then add the user to the group with these commands:
sudo useradd nagios
sudo groupadd nagcmd
sudo usermod -a -G nagcmd nagios

Let's install Nagios now.

Install Nagios Core

Download the source code for the latest stable release of Nagios Core. Go to the Nagios downloads page, and click the Skip to download link below the form. Copy the link address for the latest stable release so you can download it to your Nagios server.
At the time of this writing, the latest stable release is Nagios 4.1.1. Download it to your home directory with curl:
cd ~
curl -L -O https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz
Extract the Nagios archive with this command:
tar xvf nagios-*.tar.gz
Then change to the extracted directory:
cd nagios-*
Before building Nagios, we must configure it with this command:
./configure --with-command-group=nagcmd
Now compile Nagios with this command:
make all
Now we can run these make commands to install Nagios, init scripts, and sample configuration files:
sudo make install
sudo make install-commandmode
sudo make install-init
sudo make install-config
sudo make install-webconf
In order to issue external commands via the web interface to Nagios, we must add the web server user, apache, to the nagcmd group:
·        sudo usermod -G nagcmd apache
·         
Install Nagios Plugins

Find the latest release of Nagios Plugins here: Nagios Plugins Download. Copy the link address for the latest version, and copy the link address so you can download it to your Nagios server.
At the time of this writing, the latest version is Nagios Plugins 2.1.1. Download it to your home directory with curl:
cd ~
curl -L -O http://nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz
Extract Nagios Plugins archive with this command:
tar xvf nagios-plugins-*.tar.gz
Then change to the extracted directory:
cd nagios-plugins-*
Before building Nagios Plugins, we must configure it. Use this command:
./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl
Now compile Nagios Plugins with this command:
make
Then install it with this command:
sudo make install

Install NRPE

Find the source code for the latest stable release of NRPE at the NRPE downloads page. Download the latest version to your Nagios server.
At the time of this writing, the latest release is 2.15. Download it to your home directory with curl:
·        cd ~
·         
·        curl -L -O http://downloads.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
·         
Extract the NRPE archive with this command:
·        tar xvf nrpe-*.tar.gz
·         
Then change to the extracted directory:
·        cd nrpe-*
·         
Configure NRPE with these commands:
·        ./configure --enable-command-args --with-nagios-user=nagios --with-nagios-group=nagios --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu
·         
Now build and install NRPE and its xinetd startup script with these commands:
·        make all
·         
·        sudo make install
·         
·        sudo make install-xinetd
·         
·        sudo make install-daemon-config
·         
Open the xinetd startup script in an editor:
·        sudo vi /etc/xinetd.d/nrpe
·         
Modify the only_from line by adding the private IP address of the your Nagios server to the end (substitute in the actual IP address of your server):
only_from = 127.0.0.1 10.132.224.168
Save and exit. Only the Nagios server will be allowed to communicate with NRPE.
Restart the xinetd service to start NRPE:
·        sudo service xinetd restart
·         
Now that Nagios 4 is installed, we need to configure it.

Configure Nagios

Now let's perform the initial Nagios configuration. You only need to perform this section once, on your Nagios server.

Organize Nagios Configuration

Open the main Nagios configuration file in your favorite text editor. We'll use vi to edit the file:
sudo vi /usr/local/nagios/etc/nagios.cfg
Now find an uncomment this line by deleting the #:
#cfg_dir=/usr/local/nagios/etc/servers
Save and exit.
Now create the directory that will store the configuration file for each server that you will monitor:
sudo mkdir /usr/local/nagios/etc/servers

Configure Nagios Contacts

Open the Nagios contacts configuration in your favorite text editor. We'll use vi to edit the file:
sudo vi /usr/local/nagios/etc/objects/contacts.cfg
Find the email directive, and replace its value (the highlighted part) with your own email address:
email                           nagios@localhost        ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
Save and exit.

Configure check_nrpe Command

Let's add a new command to our Nagios configuration:
·        sudo vi /usr/local/nagios/etc/objects/commands.cfg
·         
Add the following to the end of the file:
define command{
        command_name check_nrpe
        command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
Save and exit. This allows you to use the check_nrpe command in your Nagios service definitions.

Configure Apache

Use htpasswd to create an admin user, called "nagiosadmin", that can access the Nagios web interface:
sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Enter a password at the prompt. Remember this login, as you will need it to access the Nagios web interface.
Note: If you create a user that is not named "nagiosadmin", you will need to edit /usr/local/nagios/etc/cgi.cfg and change all the "nagiosadmin" references to the user you created.
Nagios is ready to be started. Let's do that, and restart Apache:
sudo systemctl start nagios.service
sudo systemctl restart httpd.service
To enable Nagios to start on server boot, run this command:
sudo chkconfig nagios on

Optional: Restrict Access by IP Address

If you want to restrict the IP addresses that can access the Nagios web interface, you will want to edit the Apache configuration file:
sudo vi /etc/httpd/conf.d/nagios.conf
Find and comment the following two lines by adding # symbols in front of them:
Order allow,deny
Allow from all
Then uncomment the following lines, by deleting the # symbols, and add the IP addresses or ranges (space delimited) that you want to allow to in the Allow from line:
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
As these lines will appear twice in the configuration file, so you will need to perform these steps once more.
Save and exit.
Now start Nagios and restart Apache to put the change into effect:
sudo systemctl restart nagios.service
sudo systemctl restart httpd.service
Nagios is now running, so let's try and log in.

Accessing the Nagios Web Interface

Open your favorite web browser, and go to your Nagios server (substitute the IP address or hostname for the highlighted part):
http://nagios_server_public_ip/nagios
Because we configured Apache to use htpasswd, you must enter the login credentials that you created earlier. We used "nagiosadmin" as the username:

After authenticating, you will be see the default Nagios home page. Click on the Hosts link, in the left navigation bar, to see which hosts Nagios is monitoring:

As you can see, Nagios is monitoring only "localhost", or itself.
Let's monitor another host with Nagios!

Monitor a CentOS 7 Host with NRPE

In this section, we'll show you how to add a new host to Nagios, so it will be monitored. Repeat this section for each CentOS or RHEL server you wish to monitor.
Note: If you want to monitor an Ubuntu or Debian server, follow the instructions in this link: Monitor an Ubuntu Host with NRPE.
On a server that you want to monitor, install the EPEL repository:
sudo yum install epel-release
Now install Nagios Plugins and NRPE:
sudo yum install nrpe nagios-plugins-all
Now, let's update the NRPE configuration file. Open it in your favorite editor (we're using vi):
sudo vi /etc/nagios/nrpe.cfg
Find the allowed_hosts directive, and add the private IP address of your Nagios server to the comma-delimited list (substitute it in place of the highlighted example):
allowed_hosts=127.0.0.1,10.132.224.168
Save and exit. This configures NRPE to accept requests from your Nagios server, via its private IP address.
Restart NRPE to put the change into effect:
sudo systemctl start nrpe.service
sudo systemctl enable nrpe.service
Once you are done installing and configuring NRPE on the hosts that you want to monitor, you will have to add these hosts to your Nagios server configuration before it will start monitoring them.

Add Host to Nagios Configuration

On your Nagios server, create a new configuration file for each of the remote hosts that you want to monitor in /usr/local/nagios/etc/servers/. Replace the highlighted word, "yourhost", with the name of your host:
sudo vi /usr/local/nagios/etc/servers/yourhost.cfg
Add in the following host definition, replacing the host_name value with your remote hostname ("web-1" in the example), the alias value with a description of the host, and the address value with the private IP address of the remote host:
define host {
        use                             linux-server
        host_name                       yourhost
        alias                           My first Apache server
        address                         10.132.234.52
        max_check_attempts              5
        check_period                    24x7
        notification_interval           30
        notification_period             24x7
}
With the configuration file above, Nagios will only monitor if the host is up or down. If this is sufficient for you, save and exit then restart Nagios. If you want to monitor particular services, read on.
Add any of these service blocks for services you want to monitor. Note that the value of check_command determines what will be monitored, including status threshold values. Here are some examples that you can add to your host's configuration file:
Ping:
define service {
        use                             generic-service
        host_name                       yourhost
        service_description             PING
        check_command                   check_ping!100.0,20%!500.0,60%
}
SSH (notifications_enabled set to 0 disables notifications for a service):
define service {
        use                             generic-service
        host_name                       yourhost
        service_description             SSH
        check_command                   check_ssh
        notifications_enabled           0
}
If you're not sure what use generic-service means, it is simply inheriting the values of a service template called "generic-service" that is defined by default.
Now save and quit. Reload your Nagios configuration to put any changes into effect:

Saturday, February 20, 2016

Cisco SG300-10 VLAN setup in home LAB

Cisco SG300-10 VLAN setup in home LAB

See my post below on how my setup is on the SG300-10 up to this point

http://glenewhittenberg.blogspot.com/2016/02/cisco-sg300-10-initial-setup-and.html



Rundown of topology

Linksys 5 port router/switch connected to cox cable modem with LAN port of Linksys set to IP 192.168.10.1/24, and WAN Port on Linksys IP set to DHCP
Ethernet cable from Linksys to SG300-10 port 1 VLAN 1
NAS of 192.168.10.100 on SG300-10 port 2 VLAN 1
PC of 192.168.10.5 on SG300-10 port 3 VLAN 1
Laptop of 10.10.10.5 on SG300-10 port 10 VLAN 2
For nodes on 192.168.10.0/24 I use gateway 192.168.1.1 (this gets changed later)
For nodes on 10.10.10.0/24 I use gateway 10.10.10.254

My attempt at a text drawing :)

cable modem->Linksys->SG300-10-VLAN1-Port-1->
                                         SG300-10-VLAN1-Port-2->NAS(192.168.10.100)
                                         SG300-10-VLAN1-Port-3->PC(192.168.10.5)
                                         SG300-10-VLAN1-Port-4
                                         SG300-10-VLAN1-Port-5
                                         SG300-10-VLAN1-Port-6
                                         SG300-10-VLAN1-Port-7
                                         SG300-10-VLAN1-Port-8
                                         SG300-10-VLAN2-Port-9
                                         SG300-10-VLAN2-Port-10->Laptop(10.10.10.5)

                         
Make sure SG300-10 is set to router mode. I did this in the initial setup. Link above for this.
   
Setup SG300-10 VLAN 1 using port[1-8] with IP 192.168.10.254/24

    SG300-10-JASPER1# conf t
    SG300-10-JASPER1(config)#interface vlan 1
    SG300-10-JASPER1(config-if)#ip address 192.168.10.254 /24
    SG300-10-JASPER1(config-if)#exit
    SG300-10-JASPER1(config)#ip default-gateway 192.168.10.1
    SG300-10-JASPER1(config)#ip name-server 192.168.10.1
    SG300-10-JASPER1(config)#do write mem
    SG300-10-JASPER1(config)#interface range FastEthernet 0/1 , FastEthernet 0/8
    SG300-10-JASPER1(config-if-range)#switchport mode access
    SG300-10-JASPER1(config-if-range)#switchport access vlan 1
    SG300-10-JASPER1(config)#do write mem

   
Setup SG300-10 VLAN 2 using port[9-10] with IP 10.10.10.254/24

    SG300-10-JASPER1# conf t
    SG300-10-JASPER1(config)#interface vlan 2
    SG300-10-JASPER1(config-if)#ip address 10.10.10.254 /24
    SG300-10-JASPER1(config-if)#exit
    SG300-10-JASPER1(config)#do write mem
    SG300-10-JASPER1(config)#interface range FastEthernet 0/9 , FastEthernet 0/10
    SG300-10-JASPER1(config-if-range)#switchport mode access
    SG300-10-JASPER1(config-if-range)#switchport access vlan 2
    SG300-10-JASPER1(config)#do write mem   


Now see if we can Ping all nodes from the SG300-10 cli.

    SG300-10-JASPER1#ping 192.168.10.254
    SG300-10-JASPER1#ping 10.10.10.254
    SG300-10-JASPER1#ping 192.168.10.1
    SG300-10-JASPER1#ping 10.10.10.5
    SG300-10-JASPER1#ping 192.168.10.100
    SG300-10-JASPER1#ping 192.168.10.5


I got responses back from all IP's pinged.

From the laptop cmd prompt I was able to ping 10.10.10.254 and 192.168.10.254, but NOT 192.168.10.1 or 192.168.10.100 or 192.168.10.5 or 8.8.8.8

I then went into my Linksys router and added the static route of:

    Destination = 10.10.10.0
    Subnet Mask = 255.255.255.0
    Gateway = 192.168.10.254

to get my VLAN 2 traffic routed back to my switch, via 192.168.10.254 on VLAN 1 IP we setup a minute ago.

I am now able to ping 192.168.10.1 and 192.168.10.100, but NOT 192.168.10.5 or 8.8.8.8

Turned off firewall on PC 192.168.10.5 and now able to ping that from laptop of 10.10.10.5

Now to get some internet on VLAN 2 so we can ping 8.8.8.8

In SG300-10 I added static route of:

    SG300-10-JASPER1(config)#ip route 0.0.0.0 /0 192.168.10.1

To get traffic from 10.10.10.0/24 out to a valid gateway to the internet.

Now all my machines on both VLANs can communicate to each other, and have internet access.
**Note I had problems with Windows PC's until I disabled the firewall on them.

Here is some tracert output from the Windows PC of 192.168.10.5

First I tracert the NAS of 192.168.10.100 on the same network/VLAN 1 of the PC

C:\Users\glenw>tracert -d 192.168.10.100

Tracing route to 192.168.10.100 over a maximum of 30 hops

  1    <1 ms    <1 ms    <1 ms  192.168.10.100

Trace complete.


As you can see everything stays on the switch and same VLAN 1

Now I tracert the laptop of 10.10.10.5 on VLAN 2.

C:\Users\glenw>tracert -d 10.10.10.5

Tracing route to 10.10.10.5 over a maximum of 30 hops

  1     1 ms     1 ms     3 ms  192.168.10.1
  2     2 ms     5 ms     5 ms  192.168.10.254
  3     2 ms    <1 ms    <1 ms  10.10.10.5

Trace complete.


As you can see the traffic goes out my route to the Linksys 192.168.10.1 VLAN 1, then gets directed back to my switch at 192.168.10.254 VLAN 1 (Remember the static route we added to the Linksys earlier), were it knows about 10.10.10.5 on VLAN 2.

Lets try and clean this up so it does not have to go the Linksys first.

First I set my gateway on the PC 192.168.10.5 from 192.168.10.1 to 192.168.10.254. Then try another tracert to 10.10.10.5

C:\Users\glenw>tracert -d 10.10.10.5

Tracing route to 10.10.10.5 over a maximum of 30 hops

  1     1 ms     5 ms     4 ms  192.168.10.254
  2    <1 ms    <1 ms    <1 ms  10.10.10.5

Trace complete.


That's better. Stays on the switch, and 4 ms quicker (half the time).

This tracert shows it uses my new gateway on the switch 192.168.10.254 VLAN1 and routes it to VLAN 2. All of this staying on the switch.

The real advantage is the traffic that can stay on the switch does, and will not have to go to the router first and compete with other traffic, just to come back to the switch again.

I will now setup the two Ethernet interfaces for my ESXi server with one on VLAN 1 and the other on VLAN 2.
I may also setup my Trendnet Gigabit POE switch on VLAN 1 for my Yealink desk phone.
There are various other devices on the Linksys Ethernet and Wifi as well. I have Ethernet from the Linksys into the AC power outlets and have devices on that.
I do not show all devices in my network below, just the ones I will connect to the SG300-10

cable modem->Linksys->SG300-10-VLAN1-Port-1
                                         SG300-10-VLAN1-Port-2->NAS(192.168.10.100)
                                         SG300-10-VLAN1-Port-3->PC(192.168.10.5)
                                         SG300-10-VLAN1-Port-4
                                         SG300-10-VLAN1-Port-5
                                         SG300-10-VLAN1-Port-6
                                         SG300-10-VLAN1-Port-7->Trendnet POE Gigabit Switch Port1
                                                                                       Trendnet POE Gigabit Switch Port2->Yealink T19
                                                                                       Trendnet POE Gigabit Switch Port3
                                                                                       Trendnet POE Gigabit Switch Port4
                                                                                       Trendnet POE Gigabit Switch Port5
                                          SG300-10-VLAN1-Port-8->ESXi-eth1(192.168.10.90 vswitch0 Management)
                                          SG300-10-VLAN2-Port-9->ESXi-eth2(vswitch1)
                                          SG300-10-VLAN2-Port-10->Laptop(10.10.10.5)


Or maybe I will put all my nodes in my LAB on the same VLAN. Or maybe I will setup a vm pfSense router in the ESXi (since I have two interfaces, one in each VLAN) so I can get supper granular with traffic between the VLANs. The neat thing is I have lots of options now. I like that!

Enjoy!

   






Wednesday, February 17, 2016

Cisco SG300-10 Initial setup and Firmware Upgrade

Cisco SG300-10 Initial setup and Firmware Upgrade

Serial into switch.
Used cable provided, straight 9 pin serial with double female ends, plus my USB to serial cable, USB and male serial ends.
At C:\ type "mode" to see what serial port the USB to serial cable is using.
Use Putty. Serial, 115200 speed, 8 data, 1 stop, and no parity or flow control.
Login with username cisco and password cisco.

User Name:cisco
Password:cisco

Please change your password from the default settings. Please change the password for better protection of your network. Do you want to change the password (Y/N)[Y] ? Y
Enter old password  : cisco
Enter new password  : password
Confirm new password: password

switch742bd5#set system mode router
Changing the switch working mode will *delete* the startup configuration file
and reset the device right after that. It is highly recommended that you will
backup it before changing the mode, continue ? (Y/N)[N] Y
switch742bd5#21-Dec-2015 17:00:25 %FILE-I-DELETE: File Delete - file URL flash://startup-config
Resetting local unit

**************************************************
*****************  SYSTEM RESET  *****************
**************************************************


Lots of other info included here before we get to prompt below.

User Name:cisco
Password:cisco

Please change your password from the default settings. Please change the password for better protection of your network. Do you want to change the password (Y/N)[Y] ?Y
Enter old password  : cisco
Enter new password  : password
Confirm new password: password

switch742bd5#


My network I want VLAN1 on is 192.168.10.0/24 with route out 192.168.10.1, DNS of 192.168.10.1, and I will use IP 192.168.10.254 for the switch IP address.

switch742bd5# conf t
switch742bd5(config)#interface vlan 1
switch742bd5(config-if)#ip address 192.168.10.254 /24
switch742bd5(config-if)#exit
switch742bd5(config)#ip default-gateway 192.168.10.1
switch742bd5(config)#ip name-server 192.168.10.1
switch742bd5(config)#exit
switch742bd5#write mem
Overwrite file [startup-config].... (Y/N)[N] ?Y
21-Dec-2015 16:57:33 %COPY-I-FILECPY: Files Copy - source URL running-config destination URL flash://startup-config
21-Dec-2015 16:57:36 %COPY-N-TRAP: The copy operation was completed successfully
Copy succeeded



Now reboot the switch and make sure the changes stuck.

switch742bd5#reload
This command will reset the whole system and disconnect your current session. Do you want to continue ? (Y/N)[N] Y
Shutting down ...


From Windows desktop I pinged the address 192.168.10.254, after the switch has rebooted.

C:\Users\glenw>ping 192.168.10.254

Pinging 192.168.10.254 with 32 bytes of data:
Reply from 192.168.10.254: bytes=32 time=1ms TTL=64
Reply from 192.168.10.254: bytes=32 time=1ms TTL=64
Reply from 192.168.10.254: bytes=32 time=1ms TTL=64
Reply from 192.168.10.254: bytes=32 time=1ms TTL=64

Ping statistics for 192.168.10.254:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 1ms, Average = 1ms


At this point I updated firmware to 1.4.2.4
I downloaded this on PC from the Cisco website and saved to my desktop.
I then logged into the web ui using username and password set prior.
Navigated to Administration -> File Management -> Upgrade/Backup Firmware/Language.
I selected Transfer Method: via HTTP/HTTPS, Save Action: Upgrade, File Type: Firmware Image.
File Name: (Browse to my desktop) sx300_fw-1424.ros
Clicked on Apply.
When finished click Done.
Now set the new firmware active under Administration -> File Management -> Active Image, Select image in drop down, and click Apply.
Now save changes under Administration -> File Management -> Copy/Save Configuration, using Source File Name: Running configuration Destination File Name: Startup configuration.
Click Apply.


Back to your Putty serial connection. Login if not already.

switch742bd5#reload
This command will reset the whole system and disconnect your current session. Do you want to continue ? (Y/N)[N] Y
Shutting down ...


After the restart verify some of your info so far.

switch742bd5#show ver
SW version    1.4.2.4 ( date  21-Dec-2015 time  16:45:33 )
Boot version    1.3.5.06 ( date  21-Jul-2013 time  15:12:10 )
HW version    V04
switch742bd5#show ip interface vlan 1


    IP Address        I/F    I/F Status  Type   Directed  Prec Redirect Status
                             admin/oper         Broadcast
------------------ --------- ---------- ------- --------- ---- -------- ------
192.168.10.254/24  vlan 1    UP/UP      Static  disable   No   enable   Valid

switch742bd5#ping 8.8.8.8
Pinging 8.8.8.8 with 18 bytes of data:

18 bytes from 8.8.8.8: icmp_seq=1. time=20 ms
18 bytes from 8.8.8.8: icmp_seq=2. time=20 ms
18 bytes from 8.8.8.8: icmp_seq=3. time=40 ms
18 bytes from 8.8.8.8: icmp_seq=4. time=20 ms

----8.8.8.8 PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms) min/avg/max = 20/25/40


switch742bd5#ping www.google.com
Pinging www.google.com (74.125.28.99) with 18 bytes of data:

18 bytes from 74.125.28.99: icmp_seq=1. time=60 ms
18 bytes from 74.125.28.99: icmp_seq=2. time=60 ms
18 bytes from 74.125.28.99: icmp_seq=3. time=60 ms
18 bytes from 74.125.28.99: icmp_seq=4. time=60 ms

----74.125.28.99 PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms) min/avg/max = 60/60/60



Now I setup a user name admin, with password password, with full rights, and will use this to SSH into the switch in the future.

switch742bd5#conf t
switch742bd5(config)#username admin password password privilege 15
switch742bd5(config)#exit
switch742bd5#write mem
Overwrite file [startup-config].... (Y/N)[N] ?Y
21-Dec-2015 16:52:11 %COPY-I-FILECPY: Files Copy - source URL running-config destination URL flash://startup-config
21-Dec-2015 16:52:14 %COPY-N-TRAP: The copy operation was completed successfully
Copy succeeded
switch742bd5#


Now turn on the SSH server

switch742bd5#conf t
switch742bd5(config)#ip ssh server
switch742bd5(config)#exit
switch742bd5#write mem
Overwrite file [startup-config].... (Y/N)[N] ?Y
Copy succeeded
switch742bd5#
switch742bd5#


You should now be able to SSH into the switch with IP 192.168.10.254 using the username admin with password password.

After you have SSH into the switch lets set a hostname. Since this is a SG300-10, it is located on a street called Jasper, and it is my first one of these..

switch742bd5#conf t
switch742bd5(config)#hostname SG300-10-JASPER1
SG300-10-JASPER1(config)#exit
SG300-10-JASPER1#write mem
Overwrite file [startup-config].... (Y/N)[N] ?Y
Copy succeeded
SG300-10-JASPER1#
SG300-10-JASPER1#


You can also turn off password aging now if you like.

SG300-10-JASPER1(config)#passwords aging 0SG300-10-JASPER1(config)#exit
SG300-10-JASPER1#show passwords configuration

Passwords aging is disabled.
Passwords complexity is enabled with the following attributes:
Minimal length: 8 characters
Minimal classes: 3
New password must be different than the current: Enabled
Maximum consecutive same characters: 3
New password must be different than the user name: Enabled
New password must be different than the manufacturer name: Enabled
switch742bd5#write mem
Overwrite file [startup-config].... (Y/N)[N] ?Y
Copy succeeded
SG300-10-JASPER1#
SG300-10-JASPER1#



If you want Jumbo frame support on your network then:

SG300-10-JASPER1(config)#port jumbo-frame 

SG300-10-JASPER1(config)#exitSG300-10-JASPER1#write mem
Overwrite file [startup-config].... (Y/N)[N] ?Y
Copy succeeded
SG300-10-JASPER1#SG300-10-JASPER1#

That's it for now. In a later post I will cover setting up VLANs. Enjoy!