Понял, с понедельника займусь. Клиентов по одному отключать год будемparadox писал(а):ну прикинте когда эти arp появляються
и когда в сети появляються какие компьютеры
либо отключайте по одному ваших клиентов

Модератор: terminus
Понял, с понедельника займусь. Клиентов по одному отключать год будемparadox писал(а):ну прикинте когда эти arp появляються
и когда в сети появляються какие компьютеры
либо отключайте по одному ваших клиентов
Код: Выделить всё
$ cat /etc/syslog.conf | grep "#"
bla-bla-bla
# Consult the syslog.conf(5) manpage.
# uncomment this to log all writes to /dev/console to /var/log/console.log
#console.info /var/log/console.log
# uncomment this to enable logging of all log messages to /var/log/all.log
# touch /var/log/all.log and chmod it to mode 600 before it will work
#*.* /var/log/all.log
$
Код: Выделить всё
reboot ~ Fri Oct 23 15:12
shutdown ~ Fri Oct 23 15:10
Код: Выделить всё
Oct 23 13:33:30 access kernel: Limiting icmp unreach response from 214 to 200 packets/sec
Код: Выделить всё
Oct 23 01:53:51 access kernel: Oct 23 01:53:51 access kernel: arp: unknown hardware address format (0xffff)
Oct 23 09:46:03 access kernel: Oct 23 09:46:03 access kernel: arp: unknown hardware address format (0xffff)
Oct 23 09:58:02 access kernel: Oct 23 09:58:02 access kernel: arp: unknown hardware address format (0xffff)
Oct 23 15:10:14 access kernel: Stopping inetd.
Oct 23 15:10:14 access kernel: Shutting down daemon processes:
Oct 23 15:10:14 access kernel: .
Oct 23 15:10:14 access kernel: Stopping cron.
Oct 23 15:10:14 access kernel: Shutting down local daemons:
Oct 23 15:10:14 access kernel: .
Oct 23 15:10:14 access kernel: Stopping mpd5.
Oct 23 15:10:14 access kernel: Waiting for PIDS: 1738
Oct 23 15:10:16 access kernel: , 1738
Oct 23 15:10:32 access last message repeated 8 times
Oct 23 15:11:51 access kernel: Loading configuration files.
Oct 23 15:11:51 access kernel: kernel dumps on /dev/ar0s1b
Oct 23 15:11:51 access kernel: Entropy harvesting:
Oct 23 15:11:51 access kernel: interrupts
Oct 23 15:11:51 access kernel: ethernet
Oct 23 15:11:51 access kernel: point_to_point
Oct 23 15:11:51 access kernel: kickstart
Oct 23 15:11:51 access kernel: .
Oct 23 15:11:51 access kernel: swapon: adding /dev/ar0s1b as swap device
Oct 23 15:11:51 access kernel: Starting file system checks:
Грубо 400. Как бы выципить это ддос, если это он (. Но там два сервака, если на обоих суммарно то где то 700...paradox писал(а):сколько клиентов обслуживает сервер?
есть предположения что вас банально ддосят
Код: Выделить всё
startup:
# configure mpd users
set user admin pass admin
set user support pass
# configure the console
set console self 127.0.0.1 5005
set console open
# configure the web server
set web self 172.25.0.121 5006
set web open
default:
load conf_def
conf_def:
create bundle template B
set iface enable proxy-arp
set iface idle 0
set iface enable tcpmssfix
set ipcp yes vjcomp
set ipcp dns ip_dbs
set bundle disable compression
set iface up-script /usr/local/etc/mpd5/scripts/shaper.pl
set iface down-script /usr/local/etc/mpd5/scripts/shaper_down.pl
load common
common:
create link template PPPoE pppoe
set link max-children 1000
set auth max-logins 1
load pppoe_server
pppoe_server:
set link action bundle B
set link enable multilink
set link disable chap pap eap
set link enable pap
set link keep-alive 60 180
load radius
set pppoe service "*"
create link template vlan50 PPPoE
set pppoe iface vlan50
set link enable incoming
create link template vlan150 PPPoE
set pppoe iface vlan150
set link enable incoming
create link template vlan151 PPPoE
set pppoe iface vlan151
set link enable incoming
... еще куча вланов
radius:
set radius server ip_rad pass port port
set radius retries 3
set radius timeout 10
set auth acct-update 300
set auth enable radius-auth
set auth enable radius-acct
set radius enable message-authentic
Код: Выделить всё
net.inet.ip.fw.one_pass=1
net.graph.recvspace=128000
net.graph.maxdgram=128000
kern.polling.enable=1
net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1
Код: Выделить всё
last pid: 43441; load averages: 0.04, 0.09, 0.04 up 0+15:49:20 16:55:17
77 processes: 5 running, 58 sleeping, 14 waiting
CPU: 0.0% user, 0.0% nice, 26.8% system, 59.5% interrupt, 13.7% idle
Mem: 33M Active, 724M Inact, 121M Wired, 12M Cache, 111M Buf, 102M Free
Swap: 2012M Total, 2012M Free
[spank@natasha ~]$ ssh access2 0K 8K WAIT 0 6:28 82.96% irq257: bge1
29 root 1 -68 - 0K 8K CPU1 1 3:52 60.50% irq256: bge0
11 root 1 171 ki31 0K 8K RUN 1 719:25 30.86% idle: cpu1
12 root 1 171 ki31 0K 8K RUN 0 737:44 27.69% idle: cpu0
37 root 1 -68 - 0K 8K - 1 168:21 2.88% dummynet
44 root 1 20 - 0K 8K syncer 1 0:51 0.49% syncer
1632 root 1 44 0 10120K 5512K select 1 4:11 0.39% snmpd
1477 root 1 44 0 3872K 1988K select 0 0:02 0.10% zebra
15 root 1 -44 - 0K 8K WAIT 0 234:36 0.00% swi1: net
13 root 1 -32 - 0K 8K RUN 1 3:50 0.00% swi4: clock sio
16 root 1 44 - 0K 8K - 0 2:30 0.00% yarrow
2 root 1 -68 - 0K 8K sleep 1 0:45 0.00% ng_queue0
3 root 1 -68 - 0K 8K sleep 1 0:44 0.00% ng_queue1
19394 root 1 44 0 3200K 1028K select 1 0:10 0.00% syslogd
5 root 1 -8 - 0K 8K - 0 0:06 0.00% g_up
6 root 1 -8 - 0K 8K - 0 0:05 0.00% g_down
1483 root 1 44 0 5088K 2704K select 0 0:03 0.00% ospfd
19 root 1 -40 - 0K 8K WAIT 1 0:03 0.00% swi2: cambio
26 root 1 -64 - 0K 8K WAIT 1 0:02 0.00% irq16: mpt0
4 root 1 -8 - 0K 8K - 0 0:02 0.00% g_event
45 root 1 -16 - 0K 8K sdflus 0 0:01 0.00% softdepflush
1364 root 1 96 0 1888K 432K select 1 0:01 0.00% devd
38 root 1 -16 - 0K 8K psleep 0 0:01 0.00% pagedaemon
1761 root 1 44 0 5892K 2460K select 1 0:01 0.00% sendmail
34295 spank 1 44 0 8444K 3104K select 0 0:01 0.00% sshd
40970 root 1 44 0 3512K 1520K CPU0 0 0:00 0.00% top
43 root 1 -4 - 0K 8K vlruwt 0 0:00 0.00% vnlru
33947 spank 1 44 0 8444K 3124K select 0 0:00 0.00% sshd
42 root 1 -16 - 0K 8K psleep 0 0:00 0.00% bufdaemon
0 root 1 -16 0 0K 0K sched 1 0:00 0.00% swapper
1773 root 1 8 0 3228K 1036K nanslp 0 0:00 0.00% cron
33952 root 1 5 0 4412K 1908K ttyin 0 0:00 0.00% bash
40 root 1 171 ki31 0K 8K pollid 0 0:00 0.00% idlepoll
33945 root 1 4 0 8444K 3092K sbwait 0 0:00 0.00% sshd
34198 root 1 4 0 8444K 3100K sbwait 1 0:00 0.00% sshd
33951 root 1 8 0 3636K 1324K wait 0 0:00 0.00% su
34328 root 1 8 0 3636K 1324K wait 1 0:00 0.00% su
33949 spank 1 8 0 4412K 1896K wait 1 0:00 0.00% bash
Код: Выделить всё
[root@access /usr/obj/usr/src/sys/ACCESS]# kgdb /usr/obj/usr/src/sys/ACCESS/kernel.debug /var/crash/vmcore.0
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Unread portion of the kernel message buffer:
Fatal trap 12: page fault while in kernel mode
cpuid = 1; apic id = 01
fault virtual address = 0x188
fault code = supervisor read, page not present
instruction pointer = 0x20:0xc072d5e4
stack pointer = 0x28:0xe59e2bb8
frame pointer = 0x28:0xe59e2bd0
code segment = base 0x0, limit 0xfffff, type 0x1b
= DPL 0, pres 1, def32 1, gran 1
processor eflags = interrupt enabled, resume, IOPL = 0
current process = 34 (dummynet)
trap number = 12
panic: page fault
cpuid = 1
Uptime: 56s
Physical memory: 2033 MB
Dumping 180 MB: 165 149 133 117 101 85 69 53 37 21 5
Reading symbols from /boot/kernel/acpi.ko...Reading symbols from /boot/kernel/acpi.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/acpi.ko
Reading symbols from /boot/kernel/if_vlan.ko...Reading symbols from /boot/kernel/if_vlan.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/if_vlan.ko
Reading symbols from /boot/kernel/ng_socket.ko...Reading symbols from /boot/kernel/ng_socket.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_socket.ko
Reading symbols from /boot/kernel/ng_mppc.ko...Reading symbols from /boot/kernel/ng_mppc.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_mppc.ko
Reading symbols from /boot/kernel/rc4.ko...Reading symbols from /boot/kernel/rc4.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/rc4.ko
Reading symbols from /boot/kernel/ng_ether.ko...Reading symbols from /boot/kernel/ng_ether.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_ether.ko
Reading symbols from /boot/kernel/ng_pppoe.ko...Reading symbols from /boot/kernel/ng_pppoe.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_pppoe.ko
Reading symbols from /boot/kernel/ng_tee.ko...Reading symbols from /boot/kernel/ng_tee.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_tee.ko
Reading symbols from /boot/kernel/ng_iface.ko...Reading symbols from /boot/kernel/ng_iface.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_iface.ko
Reading symbols from /boot/kernel/ng_ppp.ko...Reading symbols from /boot/kernel/ng_ppp.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_ppp.ko
Reading symbols from /boot/kernel/ng_tcpmss.ko...Reading symbols from /boot/kernel/ng_tcpmss.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_tcpmss.ko
Reading symbols from /boot/kernel/ng_vjc.ko...Reading symbols from /boot/kernel/ng_vjc.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_vjc.ko
#0 doadump () at pcpu.h:196
196 __asm __volatile("movl %%fs:0,%0" : "=r" (td));
Код: Выделить всё
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Cannot access memory at address 0x8fa30020
Код: Выделить всё
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Unread portion of the kernel message buffer:
Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address = 0x188
fault code = supervisor read, page not present
instruction pointer = 0x20:0xc0749334
stack pointer = 0x28:0xc3fb7bb8
frame pointer = 0x28:0xc3fb7bd0
code segment = base 0x0, limit 0xfffff, type 0x1b
= DPL 0, pres 1, def32 1, gran 1
processor eflags = interrupt enabled, resume, IOPL = 0
current process = 37 (dummynet)
trap number = 12
panic: page fault
cpuid = 0
Uptime: 9h29m2s
Physical memory: 1010 MB
Dumping 175 MB: 160 144 128 112 96 80 64 48 32 16
Reading symbols from /boot/kernel/acpi.ko...Reading symbols from /boot/kernel/acpi.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/acpi.ko
Reading symbols from /boot/kernel/if_vlan.ko...Reading symbols from /boot/kernel/if_vlan.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/if_vlan.ko
Reading symbols from /boot/kernel/ng_socket.ko...Reading symbols from /boot/kernel/ng_socket.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_socket.ko
Reading symbols from /boot/kernel/ng_mppc.ko...Reading symbols from /boot/kernel/ng_mppc.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_mppc.ko
Reading symbols from /boot/kernel/rc4.ko...Reading symbols from /boot/kernel/rc4.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/rc4.ko
Reading symbols from /boot/kernel/ng_ether.ko...Reading symbols from /boot/kernel/ng_ether.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_ether.ko
Reading symbols from /boot/kernel/ng_pppoe.ko...Reading symbols from /boot/kernel/ng_pppoe.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_pppoe.ko
Reading symbols from /boot/kernel/ng_tee.ko...Reading symbols from /boot/kernel/ng_tee.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_tee.ko
Reading symbols from /boot/kernel/ng_iface.ko...Reading symbols from /boot/kernel/ng_iface.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_iface.ko
Reading symbols from /boot/kernel/ng_ppp.ko...Reading symbols from /boot/kernel/ng_ppp.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_ppp.ko
Reading symbols from /boot/kernel/ng_tcpmss.ko...Reading symbols from /boot/kernel/ng_tcpmss.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_tcpmss.ko
Reading symbols from /boot/kernel/ng_vjc.ko...Reading symbols from /boot/kernel/ng_vjc.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/ng_vjc.ko
#0 doadump () at pcpu.h:196
196 pcpu.h: No such file or directory.
in pcpu.h
Что именно? У меня скрипт созданя нод. Или ngctl show ipfw: ? Или правила ipfw ?APM писал(а):Дайте конфиги ng_car посмотреть, оч. интересно.
Тама серв стоечный, температура:Dominator писал(а):У меня был случай, правда на слаке, тоже комп перезагружался. Это было из-за перегрева видеокарты(комп старый), поставил доп. кулеры, все стало ништяк! Так что надо проверить, не перегревается ли что-нить у компа!
Заодно проверь термопасту на проце!
Код: Выделить всё
$iface имя интерфейса
$username имя пользователя
$num_pipe номер пайпа, нужен для создания правил, каждому клиенту отводится 10 правил, создается пока только 6.
$speed_* переменные со скоростями для различных зон. Это уже либо в mysql запрос сделать для них либо еще как, все от билинга зависит
$ipaddr IP клиента
$iface =~ /.*?(\d+).*/;
$username =~ s/[\s\t]+//g;
$num_pipe = ($1 + 1)*10;
shape($username."_inet", $num_pipe, $speed_inet_out, $speed_inet_in);
shape($username."_ixnn", $num_pipe+2, $speed_ix_out, $speed_ix_in);
shape($username."_peering", $num_pipe+4, $speed_peering_out, $speed_peering_in);
$cmd = "";
for($index = 0; $index < 6; $index++){
$cmd .= "/sbin/ipfw table ".(5+$index)." delete $ipaddr 2> /dev/null\n";
}
$cmd .= "/sbin/ipfw table 6 add $ipaddr ".($num_pipe)."\n";
$cmd .= "/sbin/ipfw table 5 add $ipaddr ".($num_pipe+1)."\n";
$cmd .= "/sbin/ipfw table 8 add $ipaddr ".($num_pipe+2)."\n";
$cmd .= "/sbin/ipfw table 7 add $ipaddr ".($num_pipe+3)."\n";
$cmd .= "/sbin/ipfw table 10 add $ipaddr ".($num_pipe+4)."\n";
$cmd .= "/sbin/ipfw table 9 add $ipaddr ".($num_pipe+5)."\n";
`$cmd`;
`/bin/echo "$date: $username: Connect $tarif_name $ipaddr $iface" >> /var/log/mpd_up.log`;
sub shape{
my $node_name = $_[0];
my $table_arg = $_[1];
my $speed_in = $_[2] * 1024; #У меня скорость в килобитах, а в ng_car в битах.
my $speed_out = $_[3] * 1024;
my $cmd=sprintf("/usr/sbin/ngctl -f- <<-EOF
mkpeer ipfw: car %s upper
name ipfw:%s %s
connect %s: ipfw: lower %s
msg %s: setconf { upstream={ cbs=%d ebs=%d cir=%d greenAction=1 yellowAction=1 redAction=2 mode=3 } downstream={ cbs=%d ebs=%d cir=%d greenAction=1 yellowAction=1 redAction=2 mode=3 } }",
$table_arg,$table_arg,$node_name,$node_name,$table_arg+1,$node_name,$speed_in/8,$speed_in/8,$speed_in,$speed_out/8,$speed_out/8,$speed_out);
printf("$cmd\n");
`/usr/sbin/ngctl shutdown $node_name:`;
`$cmd`;
}
Код: Выделить всё
#Table 1 - IX
#Table 2 - Peering
#Table 3 - Local
#Table 5 - Clients out inet
#Table 6 - Clients in inet
#Table 7 - Clients out IX
#Table 8 - Clients in IX
#Table 9 - Clients out Peering
#Table 10 - Clients in Peering
#/sbin/kldload dummynet 2> /dev/null
/sbin/kldload ng_ether
/sbin/kldload ng_car
/sbin/kldload ng_ipfw
ipfw="/sbin/ipfw -q"
${ipfw} -f flush
${ipfw} -f pipe flush
${ipfw} -f queue flush
${ipfw} table all flush
#IX table 1
for string in `cat /usr/local/etc/mpd5/IX`; do
${ipfw} table 1 add $string
done
#Peering table 2
for string in `cat /usr/local/etc/mpd5/PEERING`; do
${ipfw} table 2 add $string
done
#local nets
${ipfw} table 3 add 10.0.0.0/16
и тп, их у мну немного, добавляю прям отсюда
#------------------------------------------
em0 внешний иф
$ipfw add 100 allow all from any to any in recv em0
#all out from em0
$ipfw add 101 allow all from any to any out xmit em0
#Inet->ng*
$ipfw add 102 skipto 1000 all from any to any out xmit ng*
#ng*->Inet
$ipfw add 103 skipto 2000 all from any to any in recv ng*
#me
${ipfw} add 996 allow ip from any to me
${ipfw} add 997 allow ip from me to any
#lo accept
${ipfw} add 998 allow ip from any to any via lo0
#block any
${ipfw} add 999 deny ip from any to any
#------------------Inet->ng*-------------------------------------
${ipfw} add 1001 allow ip from table\(3\) to any
#IX -> Client
${ipfw} add 1002 netgraph tablearg ip from table\(1\) to table\(8\)
#Peering -> Client
${ipfw} add 1003 netgraph tablearg ip from table\(2\) to table\(10\)
#Inet -> Client
${ipfw} add 1004 netgraph tablearg ip from any to table\(6\)
${ipfw} add 1999 deny ip from any to any
#---------------------------------------------------------------------
${ipfw} add 2001 allow ip from any to table\(3\)
#Client -> IX
#Тут скип ту сделан для того что tablearg берется занение из последней таблицы, а клиенты у мну под подают под первую
${ipfw} add 2002 skipto 2100 ip from any to table\(1\)
${ipfw} add 2100 netgraph tablearg ip from table\(7\) to any
${ipfw} add 2101 deny ip from any to any
#Client -> Peering
${ipfw} add 2003 skipto 2200 ip from any to table\(2\)
${ipfw} add 2200 netgraph tablearg ip from table\(9\) to any
${ipfw} add 2201 deny ip from any to any
#Client -> Inet
${ipfw} add 2004 netgraph tablearg ip from table\(5\) to any
${ipfw} add 2099 deny ip from any to any
${ipfw} add 2999 deny ip from any to any
Мое мнение так более понятно, а от того что там фильтров несколько тысяч нагрузка не серв не изменится, ведь отправляет туда ipfw.я вот в ng_car наглухо не понимаю вот чего. Если в случае pipe/queue я могу указать mask dst ip например и получить "класс тарифов", то в случае ng_car мне нужноп о ноде на каждого клиент+тариф?
До конца тоже не понял но по моему это количество бит на которое можно превысить circbs – Commited burst size – размер всплеска (в байтах), по умолчанию равен cir/8.
ebs – Exceeded/Peak burst size – превышение размера всплеска (в байтах), по умолчанию равен cbs.
Код: Выделить всё
mkpeer ipfw: car 333 upper
name ipfw:333 test1
connect vlad: ipfw: lower 334
msg test1: setconf { upstream={ cbs=8192 ebs=8192 cir=65536 greenAction=1 yellowAction=1 redAction=2 mode=3 } downstream={ cbs=8192 ebs=8192 cir=65536 greenAction=1 yellowAction=1 redAction=2 mode=3 } }
Код: Выделить всё
mkpeer vlan155: car lower lower
name vlan155:lower test2
connect vlan155: ivan: upper upper
msg test2: setconf { upstream={ cbs=65536 ebs=65536 cir=524288 greenAction=1 yellowAction=1 redAction=3 } downstream={ cbs=65536 ebs=65536 cir=524288 greenAction=1 yellowAction=1 redAction=3 } }
Код: Выделить всё
Rec'd response "getstats" (1) from "[28e]:":
Args: { upstream={ passed=101699 green=98437 yellow=781 red=2481 errors=2481 } downstream={ passed=85317 green=81368 yellow=384 red=3565 errors=3565 } }
cir - Committed Information Rate - согласованная информационная скорость канала (бит/с).
Cbs - Committed Burst Size - количество бит, которое может быть передано по логическому каналу за интервал времени.
Ebs – Exceeded/Peak Burst Size - количество бит, на которое может быть превышено значение cbs за интервал времени.