Amarrado de IP con ARP OpenBSD

Crear un archivo llamado ipmac en /etc coloque el código siguiente:

 
Mac IP # atado 
10.10.0.1 00: 00: 00: 00: 00 
10.10.0.2 00: 00: 00: 00: 00 
10.10.0.3 00: 00: 00: 00: 00 
10.10.0.....


 .... y así sucesivamente.

 Para activar el uso del siguiente comando: #arp -f /etc/macip

Explicación:

Básicamente utiliza la tabla ARP fija de acuerdo con el archivo /etc/ipmac

Para deshacer el siguiente código #arp -d

Bloquear facebook.com y otros con OpenBSD 6.x y Unbound

¿Que es Unbound?: 

Unbound es un producto de resolución DNS caché, recursivo y de validación de NLnet Labs. Se distribuye de forma gratuita en formato de código abierto bajo la licencia BSD.

Archivos de Configiración

/var/unbound/etc/unbound.conf


## Simple recursive caching DNS, UDP port 53
## unbound.conf -- https://calomel.org
#
server:
   access-control: 10.0.0.0/8 allow
   access-control: 127.0.0.0/8 allow
   access-control: 192.168.0.0/16 allow
   cache-max-ttl: 14400
   cache-min-ttl: 900
   hide-identity: yes
   hide-version: yes
   interface: 0.0.0.0
   minimal-responses: yes
   prefetch: yes
   qname-minimisation: yes
   rrset-roundrobin: yes
   use-caps-for-id: yes
   verbosity: 1


local-zone: "facebook.com" redirect
local-data: "facebook.com A 127.0.0.1" 

local-zone: "youtube.com" redirect
local-data: "youtube.com A 127.0.0.1" 

local-zone: "minijuegos.com" redirect
local-data: "minijuegos.com A 127.0.0.1"
 


forward-zone:
      name: "."
      forward-addr: 199.85.126.30        # Norton ConnectSafe Bloquea porno y malware
      forward-addr: 199.85.127.30        # Norton ConnectSafe Bloquea porno y malware


Para agregar Unbound los servicios al arranque en el archivo  rc.conf.local usar el comando

# rcctl enable unbound

Instalar Python en OpenBSD

Create a symbol link for python after installing it on OpenBSD

# pkg_add python
quirks-2.304 signed on 2017-04-02T15:01:33Z
Ambiguous: choose package for python
a       0: <None>
        1: python-2.7.13p0
        2: python-3.4.5p2
        3: python-3.5.2p2
        4: python-3.6.0p0
Your choice: 4
It won’t create a symbol link by default:

# python
ksh: python: not found
So for using it handily, you can create a symbol link yourself:

# cd /usr/local/bin
# ln -s python3.6 python

Importar archivo “.sql” desde la consola mysql

Importar un archivo desde phpmyadmin es algo lento y hay que configurar unos parametros en el php.ini cuando son archivos demasiado grandes, para ahorrarse toda la espera en el navegador recomiendo importar el archivo sql desde la consola de mysql, para esto se debe iniciar sesion desde la consola (Es lo mismo para windows como para linux)
(Iniciamos sesion)
1
mysql -uUSUARIO -pPASSWORD
(usamos la bd donde queremos importar el archivo sql, en mi caso es una tabla)
1
use nombreBasedatos;
(source es el comando donde se llamara el archivo como parametro y comenzara hacer todo).
1
source /home/nombreusuario/archivo.sql

Cambiar Password en OpenBSD

How do I change root user or any other user account password under OpenBSD operating systems?
You need to use the passwd command. It can changes the user’s local password stored in /etc/master.passwd file, Kerberos, or YP password. A root user can change any users password. Normal user can only change their own password.

Task: OpenBSD Change root User Password

Login as root user and enter:
# passwd

Task: OpenBSD Change Other User Account Password

Login as root user and enter:
# passwd {userName}
To change the password for tom user account, enter:
# passwd tom

Task: OpenBSD Change Your Own Password

Simply type the passwd command:
$ passwd
First, the user is prompted for their current password. If the current password is correctly typed, a new password is requested. The new password must be entered twice to avoid typing errors.

Power Management

You may also want to enable apmd to save power if your hardware supports it. It will scale the CPU down during idle times and turn it up when the load reaches a certain point. Check the man page for a few different options.
# echo 'apmd_flags="-A"' >> /etc/rc.conf.local
# /etc/rc.d/apmd start
You can check what level (with 0 being the lowest, 100 being the highest) the CPU is running at with:
# sysctl hw.setperf
Try different levels and apmd settings to find the balance you're most comfortable with. Always running it on the lowest setting might limit the data throughput too much, but it will really depend on what hardware you're using.

Bandwidth Statistics

Monitoring how much bandwidth is being used is a common feature of many routers. The same thing can be done on an OpenBSD box quite easily. We'll install the "vnstat" daemon and tell it to monitor each interface.
# pkg_add vnstat
# vnstat -u -i em0
# vnstat -u -i em1
# vnstat -u -i em2
# vnstat -u -i em3
# chown _vnstat /var/db/vnstat/*
If you only care about WAN traffic statistics, just enable it for the egress interface, which is em0 in my case. Next, make any changes you want to the configuration file:
# vi /etc/vnstat.conf
I like to make things a bit more human-readable:
--- vnstat.conf     Sat May  2 21:15:35 2015
+++ vnstat.conf     Sat May  2 21:13:32 2015
@@ -28,7 +28,7 @@
 # how units are prefixed when traffic is shown
 # 0 = IEC standard prefixes (KiB/MiB/GiB/TiB)
 # 1 = old style binary prefixes (KB/MB/GB/TB)
-UnitMode 0
+UnitMode 1

 # output style
 # 0 = minimal & narrow, 1 = bar column visible
@@ -37,11 +37,11 @@
 OutputStyle 3

 # used rate unit (0 = bytes, 1 = bits)
-RateUnit 1
+RateUnit 0

 # maximum bandwidth (Mbit) for all interfaces, 0 = disable feature
 # (unless interface specific limit is given)
-MaxBandwidth 100
+MaxBandwidth 0

 # interface specific limits
 #  example 8Mbit limit for 'ethnone':
Be sure to add the rc.d script to your startup items, alongside dnscrypt-proxy.
# grep scripts /etc/rc.conf.local

pkg_scripts="dnscrypt_proxy vnstatd"
Finally, start the daemon.
# /etc/rc.d/vnstatd start
Wait a few minutes and it should start collecting data.
# vnstat -i em0

    Database updated: Tue Jun  9 15:41:10 2015

   em0 since 05/02/15

          rx:  334.15 GB      tx:  110.72 GB      total:  444.88 GB

   monthly
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
       May '15     265.71 GB |    53.94 GB |   319.66 GB |    125.14 KB/s
       Jun '15      68.44 GB |    56.78 GB |   125.22 GB |    175.62 KB/s
     ------------------------+-------------+-------------+---------------
     estimated     237.26 GB |   196.85 GB |   434.11 GB |

   daily
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     yesterday       3.03 GB |     1.43 GB |     4.46 GB |     54.09 KB/s
         today       2.68 GB |   134.89 MB |     2.82 GB |     52.28 KB/s
     ------------------------+-------------+-------------+---------------
     estimated       4.11 GB |      205 MB |     4.31 GB |
That's all there is to it.