Инструменты пользователя

Инструменты сайта


wiki:openbsd:t77w968

Это старая версия документа!


OpenBSD install DW5821e Snapdragon X20 LTE T77W968

Подключение к провайдеру t2

После установки OpenBSD я пробросил в виртуалку модем и добавил один файлик с настройками интерфейса umb0 И tele2 сразу же подключился и работает ))

#
# Установил nano
#
 
pkg_add nano
 
#
# собственно, сам файл
#
 
cat /etc/hostname.umb0                                                                                                                                                                                                                              
 
apn internet.tele2.ru
inet autoconf

Установка времени по Москве

Все известные временные зоны находятся в директории /usr/share/zoneinfo/

# 
# All TZ list
 
ls /usr/share/zoneinfo/

Переводим время на московское

ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime
 
# Проверяем - дата по Москве!
date

openbsd ospfd enable

#
# Не работает ospfctl
#
ospfctl s s           
ospfctl: connect: /var/run/ospfd.sock.0: Connection refused
 
cat /etc/ospfd.conf
hi="5"
area 0.0.0.0 {
        interface em0 {
                hello-interval $hi
        }
}
 
 
chmod 640 /etc/ospfd.conf
 
/etc/rc.d/ospfd start
 
#
# работает!
#
openbsd# ospfctl s s 
Router ID: 7.6.18.72
Uptime: 00:00:08
RFC1583 compatibility flag is disabled
SPF delay is 1000 msec(s), hold time between two SPFs is 5000 msec(s)
Number of external LSA(s) 0 (Checksum sum 0x0)
Number of areas attached to this router: 1
 
Area ID: 0.0.0.0
  Number of interfaces in this area: 1
  Number of fully adjacent neighbors in this area: 0
  SPF algorithm executed 1 time(s)
  Number LSA(s) 1 (Checksum sum 0x98a5)

Если не запускается, то нужно посмотреть логи демона при старте

#
# startlog
#
/etc/rc.d/ospfd -fd start

openBSD NAT enable

#
# openBSD NAT enable 
#
 
echo 'net.inet.ip.forwarding=1' >> /etc/sysctl.conf
 
sysctl net.inet.ip.forwarding=1

openBSD несколько конфигов openvpn

#
# openBSD 2 or more openvpn configs  
#
 
cat /etc/hostname.tun1 
up
!/usr/local/sbin/openvpn --daemon --config /etc/openvpn/first.conf
 
 
cat /etc/hostname.tun2 
up
!/usr/local/sbin/openvpn --daemon --config /etc/openvpn/second.conf

openBSD restart pf

#
# openbsd restart pf - reload pf config
#
 
pfctl -f /etc/pf.conf

pftl

PF reload test load

# Loading PF Rules
# Load /etc/pf.conf:
 
pfctl -f /etc/pf.conf
 
# Test the rules: (parse /etc/pf.conf but dont load it)
 
pfctl -n -f /etc/pf.conf
 
# Load only the FILTER rules:
 
pfctl -R -f /etc/pf.conf
 
# Load only the NAT rules:
 
pfctl -N -f /etc/pf.conf
 
# Load only the OPTION rules:
 
pfctl -O -f /etc/pf.conf

PF flush rules

#
# Flush ALL:
#
 
pfctl -F all
 
# Flush only the RULES:
 
pfctl -F rules
 
# Flush only QUEUE:
 
pfctl -F queue
 
# Flush only NAT:
 
pfctl -F nat
 
# Flush all statistics that are not part of any rule:
 
pfctl -F info
 
# Clear all counters:
 
pfctl -z

Output PF Info

#
# Output PF Information
# 
 
# Show filter information:
 
pfctl -s rules
 
# or
 
pfctl -sr
 
# Show filter information for which FILTER rules hit:
 
pfctl -v -s rules
 
# Filter information as above and prepend rule numbers:
 
pfctl -vvsr show
 
# Show NAT information, for which NAT rules hit:
 
pfctl -v -s nat
 
# Show NAT information for interface xl1:
 
pfctl -s nat -i xl1
 
# Show QUEUE information:
 
pfctl -s queue
 
# Show LABEL information:
 
pfctl -s label
 
# Show contents of the STATE table:
 
pfctl -s state
 
# Show statistics for state tables and packet normalization:
 
pfctl -s info
 
# Show everything:
 
pfctl -s all

PF Tables

 
#
# Работа с таблицами PF Tables #
#
 
# Show table obxod:
 
pfctl -t obxod -T show
 
# View global information about all tables:
 
pfctl -vvsTables
 
# Add entry to table obxod
 
pfctl -t obxod -T add 192.168.0.5
 
# Add a network to table obxod:
 
pfctl -t obxod -T add 192.168.0.0/16
 
# Delete nework from table obxod:
 
pfctl -t obxod -T delete 192.168.0.0/16
 
# Remove all entries from table obxod:
 
pfctl -t obxod -T flush
 
# Delete table obxod entirely:
 
pfctl -t obxod -T kill
 
# Reload table obxod on the fly:
 
pfctl -t obxod -T replace -f /etc/obxod
 
# Find ip address 192.168.0.140 in table obxod:
 
pfctl -t obxod -T test 192.168.0.140
 
# Load a new table definition:
 
pfctl -T load -f /etc/pf.conf
 
# Output stats for each ip address in table obxod:
 
pfctl -t obxod -T show -vi
 
# Reset all counters for table obxod:
 
pfctl -t obxod -T zero

openbsd FAQ OpenBSD Handbook

wiki/openbsd/t77w968.1738528207.txt.gz · Последнее изменение: 2025/02/02 23:30 — Diman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki