Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Runar Borge
microdep
Commits
cd2bc612
Commit
cd2bc612
authored
Mar 16, 2020
by
Olav Kvittem
Browse files
tcpdump igmp support; add to sudoers
parent
3aeba608
Changes
5
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
cd2bc612
...
...
@@ -9,7 +9,7 @@ Scripts to run rude/crude, traceroute and collect results
apt install traceroute tcptraceroute
apt install libpcap-dev
git clone
-b realtime git@
scm.uninett.no
:
rude/rude.git
git clone
https://
scm.uninett.no
/
rude/rude.git
compile and link up in dragonlab/bin
ln -s ~/rude/rude/rude .
ln -s ~/rude/crude/crude .
...
...
dragonlab/bin/autostart.sh
View file @
cd2bc612
...
...
@@ -43,7 +43,7 @@ if ! pgrep -u $USER -f $vmstat >/dev/null; then
$vmstat
2> /dev/null
>
/dev/null&
fi
if
!
pgrep
-u
$USER
-f
/usr/sbin/tcpdump
>
/dev/null
;
then
$HOME
/dragonlab/bin/start-icmp
if
!
pgrep
-u
root
-f
'
/usr/sbin/tcpdump
.* icmp'
>
/dev/null
;
then
$HOME
/dragonlab/bin/start-icmp
.sh
fi
dragonlab/bin/dragonlab.sudoers
100644 → 100755
View file @
cd2bc612
echo add to /etc/sudoers.d/dragonlab
echo $USER ALL=(ALL) NOPASSWD: /usr/sbin/tcpdump
echo $USER 'ALL=(ALL) NOPASSWD: /usr/sbin/tcpdump'
echo touch $HOME/dragonlab/etc/tcpdump-imcp
\ No newline at end of file
dragonlab/bin/start-icmp
deleted
100755 → 0
View file @
3aeba608
#! /bin/sh
# dump igmp traffic to catch unreachables
.
$HOME
/dragonlab/etc/start.cfg
# pick interface with default route
IF
=
`
ip route get 158.38.62.1 | perl
-ne
'print $1 if / dev (\w+) /'
`
if
test
"
$IF
"
!=
""
&&
-f
$HOME
/dragonlab/etc/tcpdump-imcp
;
then
tomidnight
=
$((
`
date
--date
'tomorrow 00:00'
+%s
`
-
`
date
+%s
`
-
1
))
sudo
/usr/sbin/tcpdump
-i
$IF
-G
$tomidnight
-W
1
-w
${
logpath
}
/icmp-%F-%T.pcap icmp 2>>
${
logpath
}
/icmp.log
fi
server/script/rude-config-maker
View file @
cd2bc612
...
...
@@ -105,10 +105,12 @@ close $rude;
foreach
$name
(
keys
%port
){
if
(
(
!
$target
)
||
(
$target
eq
$name
)
){
$outdir
=
$name
;
open
(
$start
,
"
>
$outdir
/start.cfg
")
||
die
"
Could not open
${outdir}
/start.cfg : $!
"
;
printf
$start
"
crude_port=%s
\n
",
$port
{
$name
};
printf
$start
"
%s
",
$startcfg
;
close
$start
;
if
(
-
d
$outdir
){
open
(
$start
,
"
>
$outdir
/start.cfg
")
||
die
"
Could not open
${outdir}
/start.cfg : $!
"
;
printf
$start
"
crude_port=%s
\n
",
$port
{
$name
};
printf
$start
"
%s
",
$startcfg
;
close
$start
;
}
}
}
...
...
@@ -121,9 +123,11 @@ foreach $src ( keys %tracetarget ){
}
else
{
$outdir
=
$src
;
}
open
TRACE
,
"
>
$outdir
/trace.cfg
"
||
die
"
Could not open
$outdir
/start.cfg : $!
"
;
print
TRACE
join
("
\n
",
@
{
$tracetarget
{
$src
}}
);
close
TRACE
;
if
(
-
d
$outdir
){
open
TRACE
,
"
>
$outdir
/trace.cfg
"
||
die
"
Could not open
$outdir
/start.cfg : $!
"
;
print
TRACE
join
("
\n
",
@
{
$tracetarget
{
$src
}}
);
close
TRACE
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment