Difference between revisions of "ARPwatch"

From Notes_Wiki
Line 56: Line 56:


== Configure Postfix ==
== Configure Postfix ==
Install postfix to enable the mail alerts for ARPwatch
* Install the required packages
<pre>
# dnf -y install epel-release
# dnf -y install cyrus-sasl cyrus-sasl-plain cyrus-sasl-lib postfix
# dnf -y install s-nail
</pre>
* Configure the following in main.cf file
<pre>
# vim /etc/postfix/main.cf
</pre>
* add the following entries in their respective locations:
<pew>
      myhostname = <hostname>
      mydomain = <hostname>
      inet_interfaces = all
      inet_protocols = ipv4
      mynetworks = 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8
</pre>
* add the following at the bottom of the document:
<pre>
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_tls_security_level = may
relayhost = mail.gbb.co.in:587
sender_canonical_maps = hash:/etc/postfix/sender_canonical
</pre>
* Added the crendentials
<pre>
# vim /etc/postfix/sasl_passwd
  <mail-server>:<port>      <username>:<password>
</pre>
* rewriting all mails from root to sender
<pre>
# vim /etc/postfix/sender_canonical
      root helpdesk-noreply@gbb.co.in
      root@<hostname> helpdesk-noreply@gbb.co.in
</pre>
 
Added the sender’s address in aliases file:
# vim /etc/aliases
  root:          alerts_gbb@gbb.co.in
# newaliases

Revision as of 10:56, 14 May 2025

Home > Rocky Linux or CentOS > Rocky Linux 9.x > Rocky 9.x Network Monitoring Tools > ARPwatch

Create Virtual Machine

  • Create a Rocky 9.x VM in the Vcenter
  • Select All VLANs Trunk in Network Adapter while creating the Virtual Machine

Configure Network Scripts

Create Network Scripts for each Vlan as per the below article:

CentOS 8.x Configure ethernet port for 802.3 encapsulated trunk traffic communication

  • Example Network script ( file name: ifcfg-ens33.99)
VLAN=yes
TYPE=Vlan
PHYSDEV=ens33
VLAN_ID=99
REORDER_HDR=yes
GVRP=no
MVRP=no
HWADDR=
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
IPADDR=172.30.7.106
PREFIX=16
GATEWAY=172.30.0.1
DNS1=172.31.1.160
DNS2=8.8.8.8
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6_DISABLED=yes
IPV6INIT=no
NAME=ens33.99
DEVICE=ens33.99
ONBOOT=yes
  • Restart the Network
# systemctl restart NetworkManager
  • Remove the main interface
# nmcli connection del <interface name>
  • Ping to gateway should work for each sub-interface
  • Should be able to access the Internet

Configure Postfix

Install postfix to enable the mail alerts for ARPwatch

  • Install the required packages
# dnf -y install epel-release
# dnf -y install cyrus-sasl cyrus-sasl-plain cyrus-sasl-lib postfix
# dnf -y install s-nail
  • Configure the following in main.cf file
# vim /etc/postfix/main.cf
  • add the following entries in their respective locations:

<pew>

      myhostname = <hostname>
      mydomain = <hostname>
      inet_interfaces = all
      inet_protocols = ipv4
      mynetworks = 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8
  • add the following at the bottom of the document:
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_tls_security_level = may
relayhost = mail.gbb.co.in:587
sender_canonical_maps = hash:/etc/postfix/sender_canonical
  • Added the crendentials
# vim /etc/postfix/sasl_passwd
  <mail-server>:<port>      <username>:<password>
  • rewriting all mails from root to sender
# vim /etc/postfix/sender_canonical
       root helpdesk-noreply@gbb.co.in
       root@<hostname> helpdesk-noreply@gbb.co.in

Added the sender’s address in aliases file:

  1. vim /etc/aliases
  root:           alerts_gbb@gbb.co.in
  1. newaliases