Archive for the ‘Documentation’ Category

Ssh on different ports on different interfaces (linux).

To have sshd listen on a different port on two interfaces, you can configure the /etc/ssh/sshd_config like so:

vi /etc/ssh/sshd_config

ListenAddress 10.10.10.10:22
ListenAddress 11.11.11.11:6666

This will have sshd listening on port 22 on the interface configured with IP address 10.10.10.10 and port 6666 on the interface configured with IP address 11.11.11.11.

Restart sshd:

systemctl restart sshd

Cisco 3750 switch – multiple failover static routes

I needed to set up a few fail over routes in case an intermediate route became unavailable. And I needed to do this for two different scenarios.

Create your IP SLAs:

ip sla 1
icmp-echo 10.10.10.111 source-ip 10.10.10.123
timeout 1000
threshold 2
frequency 3
ip sla schedule 1 life forever start-time now

This is ping testing 10.10.10.111 from 10.10.10.123 to verify that the primary hop is available.

ip sla 2
icmp-echo 10.10.11.222 source-ip 10.10.22.123
timeout 1000
threshold 2
frequency 3
ip sla schedule 2 life forever start-time now

Likewise, this is ping testing 10.10.11.222 from 10.10.22.123 to verify that the primary hop is available.

Create your routes (Note: The IP security version of IOS is not needed for this.)::

ip route 0.0.0.0 0.0.0.0 10.10.10.111 track 1
ip route 0.0.0.0 0.0.0.0 10.10.10.222 10

In this case, the default route on the 3750 is to 10.10.10.111, however if it is unavailable, then the default route is to 10.10.10.222.

However, traffic to 10.10.11.10 and 192.168.0.20 should route to 10.10.11.222 by default and 10.10.11.223 when 10.10.11.222 is unavailable.

ip route 10.10.11.10 255.255.255.255 10.10.11.222 track 2
ip route 192.168.0.20 255.255.255.255 10.10.11.222 track 2
ip route 10.10.11.10 255.255.255.0 10.10.11.223
ip route 192.168.0.20 255.255.255.0 10.10.11.223

Activate the tracks with the following statements:

track 1 ip sla 1 reachability
track 2 ip sla 2 reachability

Here are some useful commands to look at the configuration/status:

#show ip sla application
IP Service Level Agreement Technologies

IPSLAs Infrastructure version: Engine-II

Supported Operation Types:
dhcp, dns, echo, ftp, http, jitter, mpls jitter, pathEcho
pathJitter, tcpConnect, udpEcho
Supported Features:
IPSLAs Event Publisher

IP SLAs low memory water mark: 8441624

Estimated system max number of entries: 6182
Estimated number of configurable operations: 4524
Number of Entries configured : 2
Number of active Entries : 2
Number of pending Entries : 0
Number of inactive Entries : 0

Last time the operation configuration changed: 17:54:49.625 PST Tue Nov 13 2018

#show ip sla configuration
IP SLAs, Infrastructure Engine-II

Entry number: 1
Owner:
Tag:
Type of operation to perform: echo
Target address: 10.10.10.111
Source address: 10.10.10.123
Request size (ARR data portion): 28
Operation timeout (milliseconds): 1000
Type Of Service parameters: 0x0
Verify data: No
Vrf Name:
Schedule:
Operation frequency (seconds): 3
Next Scheduled Start Time: Start Time already passed
Group Scheduled : FALSE
Randomly Scheduled : FALSE
Life (seconds): Forever
Entry Ageout (seconds): never
Recurring (Starting Everyday): FALSE
Status of entry (SNMP RowStatus): Active
Threshold (milliseconds): 2
Distribution Statistics:
Number of statistic hours kept: 2
Number of statistic distribution buckets kept: 1
Statistic distribution interval (milliseconds): 20
History Statistics:
Number of history Lives kept: 0
Number of history Buckets kept: 15
History Filter Type: None
Enhanced History:

Entry number: 2
Owner:
Tag:
Type of operation to perform: echo
Target address: 10.10.11.222
Source address: 10.10.22.123
Request size (ARR data portion): 28
Operation timeout (milliseconds): 1000
Type Of Service parameters: 0x0
Verify data: No
Vrf Name:
Schedule:
Operation frequency (seconds): 3
Next Scheduled Start Time: Start Time already passed
Group Scheduled : FALSE
Randomly Scheduled : FALSE
Life (seconds): Forever
Entry Ageout (seconds): never
Recurring (Starting Everyday): FALSE
Status of entry (SNMP RowStatus): Active
Threshold (milliseconds): 2
Distribution Statistics:
Number of statistic hours kept: 2
Number of statistic distribution buckets kept: 1
Statistic distribution interval (milliseconds): 20
History Statistics:
Number of history Lives kept: 0
Number of history Buckets kept: 15
History Filter Type: None
Enhanced History:

#show ip sla statistics

Round Trip Time (RTT) for Index 1
Type of operation: icmp-echo
Latest RTT: 1 ms
Latest operation start time: 11:29:19.092 PST Wed Nov 14 2018
Latest operation return code: OK
Number of successes: 151
Number of failures: 9
Operation time to live: Forever

Round Trip Time (RTT) for Index 2
Type of operation: icmp-echo
Latest RTT: 1 ms
Latest operation start time: 11:29:16.634 PST Wed Nov 14 2018
Latest operation return code: OK
Number of successes: 663
Number of failures: 26
Operation time to live: Forever

CentOS – create a swap file.

I have done a few times before but don’t have to do it very often, just noting it here.

Create an empty file. The following will create a 1GB file.:

# dd if=/dev/zero of=/var/swapfile bs=1024 count=1024000
1024000+0 records in
1024000+0 records out
1048576000 bytes (1.0 GB) copied, 10.9243 s, 96.0 MB/s

Change the permission:

# chmod 0600 /var/swapfile

Create the swap area:

# mkswap /var/swapfile
Setting up swapspace version 1, size = 1023996 KiB
no label, UUID=957c2a0c-30f9-4dd7-89ed-d88b9f471294

Enable the swap area:

# swapon /var/swapfile

Enable the swap area at boot by adding it to the /etc/fstab:

# vi /etc/fstab

/var/swapfile swap swap defaults 0 0

Disable the swap area:

# swapoff /var/swapfile

Cisco and SCP Notes

Using scp top copy configuration files and update software on Cisco equipment is a much better and secure way than tftp/ftp. Here are the basics for a couple Cisco devices.

ASA 5525:
To enable scp on a Cisco ASA running version 9.x:
(config)# ssh scopy enable

To harden ssh on a Cisco ASA running version 9.x:
(config)# ssh stricthostkeycheck
(config)# ssh timeout 60
(config)# ssh version 2
(config)# ssh cipher encryption medium
(config)# ssh cipher integrity medium
(config)# ssh key-exchange group dh-group14-sha1

How to copy a running configuration using scp:
# copy system:/running-config scp://username@aaa.bbb.ccc.ddd/myconfigname.cfg

3750 Switch Notes:
To enable scp on a 3750 switch:
#ip scp server enable

How to copy a running configuration from the ASA using scp:
#copy system:/running-config scp://username@aaa.bbb.ccc.ddd/myconfigname.cfg

How to copy from remote linux client:
# scp username@aaa.bbb.ccc.ddd:system:running-config .

Protected: ASA Clue

This content is password protected. To view it please enter your password below:

Manually Configure IP address in CentOS7/RHEL7.

Let me just preface this post by saying “This is not a persistent configuration. If you boot the system, these settings will be lost unless you save them via the /etc/sysconfig/network-scripts files or through NetworkManager.

Here is how you can manually configure the IP address and gateway in CentOS/RHEL7:

Configure the IP address and subnet mask:

# ip addr add aaa.bbb.ccc.ddd/ss dev interface

For example:

# ip addr add 123.123.123.123/24 dev eno1

Likewise, to remove the IP address:

# ip addr del 123.123.123.123/24 dev eno1

To configure the default gateway:

# ip route add default via ddd.ccc.bbb.aaa dev interface

For example:

# ip route add default via 123.123.123.254 dev eno1

Same kind of thing to remove the currently configured gateway:

# ip route del default via 123.123.123.254 dev eno1

Once you have the interface configure, bring it up:

# if link set eno1 up

And to take it down:

# if link set eno1 down

Exchange View the Mailboxes a User has Permission to Access

Exchange via EMC:

This will search all of the mailboxes to determine which a user has FullAccess permissions:

[PS] > Get-Mailbox | Get-MailboxPermission | Where { ($_.AccessRights -eq “FullAccess”) -and ($_.User -like “DOMAIN\USER”)} | FormatList

RunspaceId : 12345678-1234-5678-9012-123456789012
AccessRights : {FullAccess}
Deny : False
InheritanceType : All
User : DOMAIN\USER
Identity : DOMAIN.LOCAL/Users/Firstname Lastname
IsInherited : False
IsValid : True

It can take a while, but it will give you the results.

Mounting Shares via Windows Alternate Names In Linux

On the server you want to mount a share, use the following list all names for the server:

NETDOM COMPUTERNAME servrname /ENUM

Example:

C:\>netdom computername dc01 /enum
All of the names for the computer are:

DC01.domain.tld
The command completed successfully.

To add a new name:

NETDOM COMPUTERNAME servername /ADD othername.domain.tld

And then to get the name registered into your DNS:

IPCONFIG /REGISTERDNS

Now, when you list the names, you will see the new one:

C:\>netdom computername dc01 /enum
All of the names for the computer are:

DC01.domain.tld
othername.domain.tld
The command completed successfully.

To delete a name:

NETDOM COMPUTERNAME servername /REMOVE othername.domain.tld
IPCONFIG /REGISTERDNS

When using Samba in linux to mount via an alternate server name, you need to make sure you specify the SMB version as a option.

For example:

/etc/fstab:

//othername.domain.tld/sharename /MountPoint cifs vers=3.0,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

Windows 2016 Create a Service

To run a program as a service, bring up an Administrator command prompt and:

C:\> SC CREATE “JGZs Service” binPath=”C:\MyPrograms\JGZsService.exe”

Then you can start the service via the SC command:

C:\> SC START “JGZs Service”

Or from the Services Control Panel applet.

Windows Server 2016 Proxy Settings For Local Computer

To set the proxy for all users that logon to Windows Server 2016 or Windows 10, you can configure your settings in Internet Explorer or through Internet Options from a Administrator level account on the machine.

Then, bring an Administrator command prompt and enter the following:

C:\>netsh winhttp import proxy source=ie

Return top

INFORMATION