MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 18.222.163.231
Web Server : Apache
System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : ppcad7no ( 715)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /../usr/libexec/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //../usr/libexec/ebtables
#!/bin/bash

RETVAL=0

initialize() {
  # Initialize $TYPE tables
  echo -n $"  $TYPE tables: "
  if [ -r /etc/sysconfig/ebtables.$TYPE ]; then
    /sbin/ebtables -t $TYPE --atomic-file /etc/sysconfig/ebtables.$TYPE --atomic-commit > /dev/null || RETVAL=1
  else
    echo -n "not configured"
  fi
  if [ $RETVAL -eq 0 ]; then
    echo -n $"[  OK  ]"
    echo -ne "\r"
  else
    echo -n $"[FAILED]"
    echo -ne "\r"
  fi
}

case $1 in
  start)
   # Initialize	filter tables
   TYPE=filter
   initialize
 
   # Initialize NAT tables
   echo
   TYPE=nat
   initialize

   # Initialize broute tables
   echo
   TYPE=broute
   initialize
  ;;
  stop)
    /sbin/ebtables -t filter --init-table || RETVAL=1
    /sbin/ebtables -t nat --init-table || RETVAL=1
    /sbin/ebtables -t broute --init-table || RETVAL=1

    for mod in $(grep -E '^(ebt|ebtable)_' /proc/modules | cut -f1 -d' ') ebtables; do
       /sbin/rmmod $mod || RETVAL=1
    done

    if [ $RETVAL -eq 0 ]; then
      echo -n $"[  OK  ]"
      echo -ne "\r"
    else
      echo -n $"[FAILED]"
      echo -ne "\r"
    fi
  ;;
  save)
    echo -n $"Saving Ethernet bridge filtering (ebtables): "
    /sbin/ebtables -t filter --atomic-file /etc/sysconfig/ebtables.filter --atomic-save || RETVAL=1
    /sbin/ebtables -t nat --atomic-file /etc/sysconfig/ebtables.nat --atomic-save || RETVAL=1
    /sbin/ebtables -t broute --atomic-file /etc/sysconfig/ebtables.broute --atomic-save || RETVAL=1
    if [ $RETVAL -eq 0 ]; then
      echo -n $"[  OK  ]"
      echo -ne "\r"
    else
      echo -n $"[FAILED]"
      echo -ne "\r"
    fi
  ;;
  *)
    echo "usage: ${0##*/} {start|stop|save}" >&2
    exit 1
  ;;
esac

# vim:set ts=2 sw=2 ft=sh et:

MMCT - 2023