Configuring SNMP Traps on D-Link Switches

I will give an example of setting up SNMP Traps sending on D-Link switches.
For example, I will take the switches D-Link DES-3200-x:

Create an SNMP password:

create snmp community public view CommunityView read_only

We indicate which host and with which password the traps should be sent:

create snmp host x.x.x.x v2c public

We indicate the change in the state of which ports to send traps:

config snmp link_traps ports 01-24 disable
config snmp link_traps ports 25-26 enable

Check the configuration of sending snmp traps with the command:

show snmp traps

Check the configuration of sending snmp traps on the status of ports with the command:

show snmp traps link_traps

At the end of the command, you can digitize port numbers.

See also my article:
Installing and using Net-SNMP

Block third-party DHCP servers on the Huawei Quidway S2300 (DHCP Snooping)

I will give an example of how on the Huawei Quidway S2300 switch (using the S2326TP-EI as an example) to allow receiving DHCP responses from the uplink port and prohibiting client responses.

Continue reading “Block third-party DHCP servers on the Huawei Quidway S2300 (DHCP Snooping)”

Install and configure Sphinx in Ubuntu

Sphinx – search engine with integration of API and MySQL databases, PostgreSQL.

Installation command:

sudo apt-get install sphinxsearch

After installation, tcp ports 9312 and 9306 are used.

Install the MySQL database server:

sudo apt-get install mysql-server mysql-client

Create a test database:

mysql -u root -p
CREATE DATABASE test;
SOURCE /etc/sphinxsearch/example.sql;
quit

Make a copy of the sample configuration file:

sudo cp /etc/sphinxsearch/sphinx.conf.sample /etc/sphinxsearch/sphinx.conf

Fill in the required parameters including data for connecting to the database.
An example of opening a configuration file in the nano editor (Ctrl+X to exit and y/n to save or discard changes):

sudo nano /etc/sphinxsearch/sphinx.conf

Activate sphinxsearch by specifying START=yes in the following file:

sudo nano /etc/default/sphinxsearch

Run sphinxsearch:

sudo service sphinxsearch start

Adding data to the index:

sudo indexer --all

An example of adding to cron:

sudo crontab -e
@hourly /usr/bin/indexer --rotate --config /etc/sphinxsearch/sphinx.conf --all

Command line search example:

search TEXT

Asterisk compile error solution “‘pjsip_tcp_transport_cfg’ has no member named ‘sockopt_params’”

Once I compiled Asterisk version 13.13.1 and when running make I noticed the following error:

‘pjsip_tcp_transport_cfg’ has no member named ‘sockopt_params’

pjproject-2.2.1 has already been compiled.

Solved the problem by compiling a newer version of pjproject-2.4.5

cd /usr/src
wget http://www.pjsip.org/release/2.4.5/pjproject-2.4.5.tar.bz2
tar -xjvf pjproject-2.4.5.tar.bz2
cd pjproject-2.4.5
CFLAGS='-DPJ_HAS_IPV6=1' ./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr
make dep
make
make install

After that, the error disappeared.

Configure IP Unnumbered on Cisco

On the test I will configure IP Unnumbered on Cisco Catalyst 6509E with firmware 12.2(33)SXJ7, on other switches the setup is similar.
IP Unnumbered is useful, for example, when it is necessary to divide a large network into several VLANs and use the same IP addresses and also to issue white IPs in any VLAN using one gateway.

Connect to the terminal device through the console, telnet or SSH.

Continue reading “Configure IP Unnumbered on Cisco”

View and configure sharing of files and folders Windows from the command line

I will give an example of some commands for setting up sharing of resources.

View shared resources:

net share

Deleting a shared resource:

net share <sharename> /delete

Sharing a folder:

net share sharename=C:\dir

Example of disconnecting users from the share:

net session \\pc1 /delete

To close an open network file, use the command:

net file file_id /close

An example of granting user rights to a file (N – not set, W – write, C – change, F – full access):

cacls file.txt /G User:w

To cancel user access to a share:

cacls /R User

We allow up to 5 users to simultaneously connect to a shared resource:

net share sharename /users:5

Example of caching settings from a share (manual/BranchCache/documents/programs/none):

net share myshare /cache:manual

I want to note that when opening a share to a resource in the firewall, the following ports should be opened: TCP 139, TCP 445, UDP 137, UDP 138.

See also my articles:
Installing and using the nbtscan network scanner
Some information about the virus encryptor Trojan.Encoder.12544 attacked 06/27/2017

Hidden files and directories in Ubuntu

Method 1
Put a dot at the beginning of the file or directory name.

Method 2
Create a .hidden file, place in a directory in which you need to hide something and write in it a column of the names of files or folders that should be hidden. The case of letters has a meaning, that is, if the name of an element is from a capital letter, then write it in the .hidden file in the same way.

To see the hidden items through the Nautilus file manager, you must press the key combination Ctrl+H or in the “View” menu click “Show hidden files”.

D-Link DSR-150 router firmware upgrade

To flash the D-Link DSR-150 router, take the following necessary steps in steps:

1) Let’s look at the revision on the label under the router and download the new firmware from it from the official site http://www.dlink.ru/ru/products/9/1697_d.html

Firmware router not under the revision can lead to its failure.

2) Open the settings of the router by typing in the browser the address http://192.168.1.1 (maybe 192.168.0.1) and enter the standard login – admin, the password – admin.

3) In the opened interface at the top, open the “Tools” tab, on the left, select “Firmware“. On the page that opens, the current firmware version will be displayed, if it is older than the downloaded one, then click “Browse” and select the previously downloaded firmware file, then click “Upgrade” to start the process updates.

Wait until the update is complete, usually 2-5 minutes. At the end, the router will reboot.

Is done.