Skip to content

Commit

Permalink
Added tcpdump service commands as well as permission to use it on eac…
Browse files Browse the repository at this point in the history
…h machine
  • Loading branch information
iArcanic committed Jul 24, 2023
1 parent c3868a2 commit 5b35848
Show file tree
Hide file tree
Showing 20 changed files with 69 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Admin.startup
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ip link set up dev eth0

# Gateway IP to Management-switch
ip route add default via 10.0.6.2 dev eth0

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Central-router.startup
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,6 @@ iptables -A FORWARD -s 10.0.2.0/24 -d 10.0.5.3 -p icmp --icmp-type 8 -m state --

# Drop incoming ICMP Echo Request (ping) from LDAP to External subnet
iptables -A FORWARD -s 10.0.5.3 -d 10.0.2.0/24 -p icmp --icmp-type 8 -m state --state NEW,ESTABLISHED -j DROP

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions DMZ-switch.startup
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ip link set up dev eth0

# Gateway IP to Central-router
ip route add default via 10.0.1.1 dev eth0

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Ext-DNS.startup
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ ip route add default via 10.0.2.2 dev eth0
# Start DNS service
chmod +r /etc/dnsmasq_static_hosts.conf
systemctl start dnsmasq

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Ext-Office.startup
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ip link set up dev eth0

# Route to External-switch
ip route add default via 10.0.2.2 dev eth0

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Ext-WWW.startup
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ ip route add default via 10.0.2.2 dev eth0
a2enmod ssl
a2ensite default-ssl
systemctl start apache2

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions External-switch.startup
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ip link set up dev eth0

# Gateway IP to Central-router
ip route add default via 10.0.2.1 dev eth0

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Int-DNS.startup
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ ip route add default via 10.0.4.2 dev eth0
# Start DNS service
chmod +r /etc/dnsmasq_static_hosts.conf
systemctl start dnsmasq

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Int-WWW.startup
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ ip route add default via 10.0.4.2 dev eth0
a2enmod ssl
a2ensite default-ssl
systemctl start apache2

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions LDAP.startup
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ip link set up dev eth0

# Gateway IP to Server-switch
ip route add default via 10.0.5.2 dev eth0

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Management-switch.startup
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ip link set up dev eth0

# Gateway IP to Central-router
ip route add default via 10.0.6.1 dev eth0

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions OpenVPN.startup
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ip link set up dev eth0

# Gateway IP to Server-switch
ip route add default via 10.0.5.2 dev eth0

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Server-switch.startup
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ip link set up dev eth0

# Gateway IP to Central-router
ip route add default via 10.0.5.1 dev eth0

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Services-switch.startup
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ip link set up dev eth0

# Gateway IP to Central-router
ip route add default via 10.0.4.1 dev eth0

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Squid.startup
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ ip route add default via 10.0.1.2 dev eth0
touch /var/log/squid/access.log
chmod 777 /var/log/squid/access.log
systemctl start squid.service

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Staff-1.startup
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ip link set up dev eth0

# Route to Staff-switch
ip route add default via 10.0.3.2 dev eth0

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Staff-2.startup
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ip link set up dev eth0

# Gateway IP to Staff-switch
ip route add default via 10.0.3.2 dev eth0

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Staff-3.startup
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ip link set up dev eth0

# Gateway IP to Staff-switch
ip route add default via 10.0.3.2 dev eth0

# Start tcpdump service
systemctl start tcpdump
3 changes: 3 additions & 0 deletions Staff-switch.startup
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ip link set up dev eth0

# Gateway IP to Central-router
ip route add default via 10.0.3.1 dev eth0

# Start tcpdump service
systemctl start tcpdump
12 changes: 12 additions & 0 deletions shared/usr/lib/systemd/system/tcpdump.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Tcpdump from @device to /hostlab/.output/<filename>.pcap
Documentation=man:tcpdump(1)
After=networking.service

[Service]
Type=simple
ExecStartPre=/usr/bin/mkdir --parents /hostlab/.output
ExecStart=/usr/local/bin/tcpdump -s0 -i %i -w /hostlab/.output/%fn.pcap

[Install]
WantedBy=multi-user.target

0 comments on commit 5b35848

Please sign in to comment.