LINUX.ORG.RU

Сообщения shur1k

 

dnsmasq: duplicate IP address in dhcp-config directive. ошибка

Всем привет!

Наткнулся на следующую проблему с dnsmasq Есть два идентичных конфига:

1 - /etc/dnsmasq-company.conf

2 - /etc/dnsmasq.d/dnsmasq-company.conf

diff /etc/dnsmasq-company.conf /etc/dnsmasq.d/dnsmasq-company.conf
671d670
<

Если в dnsmasq.conf путь указан к conf-dir=/etc/dnsmasq.d, то все работает сервис перезапускается и ошибок не возникает.

# Include a another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf
conf-dir=/etc/dnsmasq.d
#conf-file=/etc/dnsmasq-company.conf

Во втором случае сервис ругается на дубликат

/etc/init.d/dnsmasq restart * Restarting DNS forwarder and DHCP server dnsmasq dnsmasq: duplicate IP address 10.0.1.222 in dhcp-config directive.

# Include a another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf
#conf-dir=/etc/dnsmasq.d
conf-file=/etc/dnsmasq-company.conf

Версия системы ubuntu 12.04 LTS

Dnsmasq version 2.59

Возможно кто-то сталкивался с подобным, беглый поиск в гугле не помог.

 , ,

shur1k
()

iptables - не все порты закрыты

Приветствую!

Прошу помочь разобраться с простейшими правилами iptables. Документацию читал, многое понятно, но что-то идет не так.

дано: Ubuntu Server 12.04 LTS eth0 - смотрит в интернет eth1 - в локальную сеть

Раздавать интернет за локальную сеть не нужно.

Задача закрыть все порты на eth0 кроме 22, eth1 разрешить все.

Скрипт с правилами

#!/bin/sh

iptables -F

iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

iptables -F
iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 58022 -j ACCEPT
iptables -A INPUT -i eth0 -p all -j DROP
iptables -A INPUT -i eth1 -p all -j ACCEPT

Вывод iptables -L -v

Chain INPUT (policy ACCEPT 9188 packets, 6425K bytes)
 pkts bytes target     prot opt in     out     source               destination
   74  7965 ACCEPT     all  --  eth0   any     anywhere             anywhere             state RELATED,ESTABLISHED
    1    64 ACCEPT     tcp  --  eth0   any     anywhere             anywhere             tcp dpt:22
  169  9600 DROP       all  --  eth0   any     anywhere             anywhere
 2615  540K ACCEPT     all  --  eth1   any     anywhere             anywhere

И вот самое интересное

Вывод nmap -PN host

Host is up (0.0041s latency).
Not shown: 997 filtered ports
PORT     STATE SERVICE
21/tcp   open  ftp
554/tcp  open  rtsp
7070/tcp open  realserver

Откуда взялись эти порты если я добавил правило: ?

iptables -A INPUT -i eth0 -p all -j DROP

 , ,

shur1k
()

Microtik 2 офиса PPTP тунель

Приветствую!

Второй день пытаюсь решить довольно простую задачу по объединению двух офисов. Делаю все согласно документации ( http://wiki.mikrotik.com/wiki/Russian/Объединяем_офисы_с_помощью_Mikrotik#.D0... )

Дано :

- Microtik RB1100 OfficeA - Microtik 750G OfficeB - Router OS 6.1 - Схема

https://www.dropbox.com/s/bxkr5pkwgy3sqzk/Screen%20Shot%202013-07-23%20at%209.49.25.png

Клиент подключается к серверу, пакеты ходят только между роутерами. С маршрутизаторов видно компьютеры в сети, но сами компьютеры друг друга не видят. Пробовал обратную схему, OfficeA - клиент OfficeB - сервер. Результат такой же.

- Microtik 750G OfficeB

 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 A S  0.0.0.0/0                          81.200.1.33               2
 1 A S  10.12.0.0/16       10.14.5.1       10.14.5.2                 1
 2 ADC  10.14.5.2/32       10.14.5.1       lam-in                    0
 3 ADC  81.200.1.33/32     81.200.1.51     ether1-gateway            0
 4 ADC  172.20.9.0/24      172.20.9.1      ether2-master-l...        0
 5 ADC  172.21.9.5/32      172.20.9.1      <pptp-support>            0

- Microtik RB1100 OfficeA

  #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 A S  0.0.0.0/0                          94.127.219.1              1
 1   S  0.0.0.0/0                          77.232.0.1                2
 2 ADC  10.12.0.0/16       10.12.1.1       LAN                       0
 3 ADC  10.12.2.249/32     10.12.1.1       <pptp-support>            0
 4 ADC  10.14.5.1/32       10.14.5.2       lam-out                   0
 5 ADC  77.232.0.0/24      77.232.0.9      ISP2                      0
 6 ADC  94.127.219.0/27    94.127.219.2    ISP1                      0
 7 ADC  172.10.2.0/24      172.10.2.1      GuestNetwork              0
 8 A S  172.20.9.0/24      10.14.5.2       10.14.5.1                 1

Прошу помочь понять что и где не так. Если есть возможность подключиться по Teamviewer и тыкнуть где ошибка, буду признателен. Спасибо в виде небольшого кол-ва Bitcoin )

 , ,

shur1k
()

OpenVPN маршрутизация

Добрый день!

Прошу помочь, с помощью мануалов пытаюсь настроить OpenVPN сервер на VPS. Задача простая, подключаемся к внешнему серверу, и через него выходим в интернет. Вот на последнем шаге я споткнулся.

Система CentOS 6.4x32 Openvpn 2.3.1

Конфиг сервера

port 1194
proto udp
dev tun
ca /etc/openvpn/easy-rsa/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/easy-rsa/2.0/keys/dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 10.8.0.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
client-to-client
keepalive 10 120
comp-lzo
persist-key
persist-tun
verb 3

Конфиг клиента

client
tls-client
verb 3
dev tun
proto udp
remote 46.19.37.162 1194
ca ca.crt
cert eva00.crt
key eva00.key
comp-lzo

netstat -rn

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.8.0.2        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
10.8.0.0        10.8.0.2        255.255.255.0   UG        0 0          0 tun0
46.19.37.0      0.0.0.0         255.255.255.0   U         0 0          0 eth0
172.16.0.0      0.0.0.0         255.255.0.0     U         0 0          0 eth1
0.0.0.0         46.19.37.1      0.0.0.0         UG        0 0          0 eth0

iptables -vn -L

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:80
    5   210 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW udp dpt:1194
 3232  325K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
    1    84 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0
    1    40 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
  202 12180 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
    4   184 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited
    0     0 ACCEPT     all  --  tap+   *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  --  tun+   *       0.0.0.0/0            0.0.0.0/0

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
  270 18323 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited
    0     0 ACCEPT     all  --  tap+   *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  --  tun+   *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  --  *      *       10.8.0.0/24          0.0.0.0/0
    0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT 3629 packets, 580K bytes)
 pkts bytes target     prot opt in     out     source               destination
net.ipv4.ip_forward = 1

Подключаюсь, прохожу авторизацию, пингую сервер 10.8.0.1 А вот все что за ним, нет.

Полагаю проблема в маршрутизации, но вот в чем именно не могу разобраться.

Спасибо )

 , ,

shur1k
()

Nagios notifications.

Всем привет!

Есть небольшая проблема. На борту Debian 6, nagios3 и postfix. Проблема заключается в том что по макросу из /etc/nagios3/conf.d/commands пиьсмо отправляется локальному пользователю, а не контактам из /etc/nagios3/objects/contacts До установки nagios стоял icinga, которую я благополучно снес с помощью apt-get remove icinga --purge облазил конфиги, никак не могу понять почему он отправляет сам себе.

Макрос:

/usr/bin/printf "%b" "Notification:\t$NOTIFICATIONTYPE$\n\nOccurred:\t$DATETIME$\nHostname:\t$HOSTALIAS$ ($HOSTADDRESS$)\nService:\t$SERVICEDESC$\nState:\t\t$SERVICESTATE$\nDetails:\n\ n$OUTPUT$" | /usr/bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ -- $SERVICESTATE$" "$CONTACTEMAIL"

Mail.log:

Jul 18 16:18:52 ls1 postfix/pickup[31764]: 49F1240B2: uid=1000 from=<ladmin>
Jul 18 16:18:52 ls1 postfix/cleanup[3120]: 49F1240B2: message-id=<20120718121852.49F1240B2@ls1>
Jul 18 16:18:52 ls1 postfix/qmgr[9174]: 49F1240B2: from=<ladmin@ls1>, size=347, nrcpt=1 (queue active)
Jul 18 16:18:52 ls1 postfix/local[3129]: 49F1240B2: to=<ladmin@ls1>, relay=local, delay=0.03, delays=0.02/0/0/0.01, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Jul 18 16:18:52 ls1 postfix/qmgr[9174]: 49F1240B2: removed

/etc/nagios3/objects/contacts.cfg

define contact{
        contact_name                    support
        contactgroups                   admins
        service_notification_period     24x7
        host_notification_period        24x7 
        service_notification_options    w,u,c,r
        host_notification_options       d,r
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        email                           user@mail.ru
        register                        1
        }

 , ,

shur1k
()

RSS подписка на новые темы