public class IptablesCommands
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
IptablesCommands.Chain |
static class |
IptablesCommands.Policy |
static class |
IptablesCommands.Protocol
Deprecated.
since 0.7; use
Protocol ; kept for persisted state backwards compatibility. |
Constructor and Description |
---|
IptablesCommands() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
addFirewalldRule(IptablesCommands.Chain chain,
<any> networkInterface,
Protocol protocol,
int port,
IptablesCommands.Policy policy)
Returns the command that adds firewalld direct rule.
|
static java.lang.String |
addFirewalldRule(IptablesCommands.Chain chain,
Protocol protocol,
int port,
IptablesCommands.Policy policy)
Returns the command that adds firewalld direct rule.
|
static java.lang.String |
addIptablesRule(java.lang.String direction,
IptablesCommands.Chain chain,
<any> networkInterface,
Protocol protocol,
int port,
IptablesCommands.Policy policy)
Returns the command that creates a rule to iptables.
|
static java.lang.String |
appendIptablesRule(IptablesCommands.Chain chain,
Protocol protocol,
int port,
IptablesCommands.Policy policy)
Returns the command that appends a rule to iptables to all interfaces.
|
static java.lang.String |
appendIptablesRule(IptablesCommands.Chain chain,
java.lang.String networkInterface,
Protocol protocol,
int port,
IptablesCommands.Policy policy)
Returns the command that appends a rule to iptables.
|
static java.lang.String |
cleanUpIptablesRules()
Returns the command that cleans up iptables rules.
|
static java.lang.String |
firewalldService(java.lang.String cmd) |
static java.lang.String |
firewalldServiceIsActive() |
static java.lang.String |
firewalldServiceRestart() |
static java.lang.String |
firewalldServiceStart() |
static java.lang.String |
firewalldServiceStatus() |
static java.lang.String |
firewalldServiceStop() |
static java.lang.String |
insertIptablesRule(IptablesCommands.Chain chain,
Protocol protocol,
int port,
IptablesCommands.Policy policy)
Returns the command that inserts a rule on top of the iptables' rules to all interfaces.
|
static java.lang.String |
insertIptablesRule(IptablesCommands.Chain chain,
java.lang.String networkInterface,
Protocol protocol,
int port,
IptablesCommands.Policy policy)
Returns the command that inserts a rule on top of the iptables' rules.
|
static java.lang.String |
iptablesService(java.lang.String cmd) |
static java.lang.String |
iptablesServiceRestart() |
static java.lang.String |
iptablesServiceStart() |
static java.lang.String |
iptablesServiceStatus() |
static java.lang.String |
iptablesServiceStop() |
static java.lang.String |
listIptablesRule()
Returns the iptables rules.
|
static java.lang.String |
saveIptablesRules()
Returns the command that saves iptables rules on file.
|
public static java.lang.String iptablesService(java.lang.String cmd)
public static java.lang.String iptablesServiceStop()
public static java.lang.String iptablesServiceStart()
public static java.lang.String iptablesServiceRestart()
public static java.lang.String iptablesServiceStatus()
public static java.lang.String firewalldService(java.lang.String cmd)
public static java.lang.String firewalldServiceStop()
public static java.lang.String firewalldServiceStart()
public static java.lang.String firewalldServiceRestart()
public static java.lang.String firewalldServiceStatus()
public static java.lang.String firewalldServiceIsActive()
public static java.lang.String saveIptablesRules()
public static java.lang.String cleanUpIptablesRules()
public static java.lang.String listIptablesRule()
public static java.lang.String insertIptablesRule(IptablesCommands.Chain chain, Protocol protocol, int port, IptablesCommands.Policy policy)
public static java.lang.String insertIptablesRule(IptablesCommands.Chain chain, java.lang.String networkInterface, Protocol protocol, int port, IptablesCommands.Policy policy)
public static java.lang.String appendIptablesRule(IptablesCommands.Chain chain, Protocol protocol, int port, IptablesCommands.Policy policy)
public static java.lang.String appendIptablesRule(IptablesCommands.Chain chain, java.lang.String networkInterface, Protocol protocol, int port, IptablesCommands.Policy policy)
public static java.lang.String addIptablesRule(java.lang.String direction, IptablesCommands.Chain chain, <any> networkInterface, Protocol protocol, int port, IptablesCommands.Policy policy)
public static java.lang.String addFirewalldRule(IptablesCommands.Chain chain, Protocol protocol, int port, IptablesCommands.Policy policy)
public static java.lang.String addFirewalldRule(IptablesCommands.Chain chain, <any> networkInterface, Protocol protocol, int port, IptablesCommands.Policy policy)