Guest User

pdmenurc iptables

a guest
Apr 10th, 2014
181
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/pdmenu
  2. ## Version: 2011-02-15
  3. ##
  4. ## By: Digital Foundations
  5. ## License: GPL
  6. ## Uses: dialog
  7. ##
  8. ## This menu is designed to give quick access to regular
  9. ## repetative tasks performed in the Linux (Debian) console.
  10. ##
  11. ## Changlog: 15/2/2012 - cleanup
  12. ## 2/2/2012 - rewrite
  13. ##
  14. # Save this file in /usr/local/bin
  15. # and chmod ugo+x /usr/local/bin/pdmenu.main
  16. #
  17. #Set a pleasing color scheme.
  18. color:desktop:blue:blue
  19. color:title:white:white
  20. color:base:white:white
  21.  
  22. #this is a comment
  23. menu:iptables:Iptables:Select
  24. exec:_iptables-save:disp:iptables-save
  25. show:_INPUT (Incoming)::incoming
  26. show:_OUTPUT (Sending)::sending
  27. exec:_Flush (remove all rules):p:iptables -F; iptables -t nat -F; iptables -t mangle -F; iptables -P INPUT ACCEPT; iptables -P FORWARD ACCEPT; iptables -P OUTPUT ACCEPT
  28. nop
  29. show:Table - _Filter::filter
  30. show:Table - _Mangle::mangle
  31. show:Table - _NAT::nat
  32. show:Table - _Raw::raw
  33. nop:-----
  34. show:_Help::iptables-help
  35. exec:_Edit menu::nano /usr/local/bin/pdmenu.iptables
  36. menu:incoming
  37. show:_PREROUTING-Mangle::prerouting-mangle
  38. show:_PREROUTING-NAT(Port Forwarding)::prerouting-nat
  39. show:_INPUT-Filter(Local)::filter-input
  40. show:_FORWARD(Packets to forward)::filter-forwarding
  41. menu:prerouting-mangle
  42. exec:_List rules:disp:iptables -t mangle --list-rules
  43. exec:_List(PREROUTING only):disp:iptables -t mangle -L PREROUTING
  44. exec:_List(All):disp:iptables -t mangle -L
  45. exec:_Insert
  46. exec:_Remove
  47. menu:prerouting-nat
  48. exec:_List rules:disp:iptables -t nat --list-rules
  49. exec:_List(PREROUTING):disp:iptables -t nat -L PREROUTING
  50. exec:_List(All):disp:iptables -t nat -L
  51. exec:_Insert
  52. exec:_Remove
  53. menu:filter-input
  54. exec:_List rules:disp:iptables -t filter --list-rules
  55. exec:_List(INPUT):disp:iptables -t filter --list-rules INPUT
  56. exec:_List(All):disp:iptables -t filter --list-rules
  57. exec:_Insert::
  58. exec:_Remove::
  59. menu:filter-forwarding
  60. exec:_List rules:disp:iptables -t filter --list-rules
  61. exec:_List(FORWARD):disp:iptables -t filter -L FORWARD
  62. exec:_List(All):disp:iptables -t filter -L
  63. exec:_Insert:edit,p:iptables -t filter -I FORWARD -p ~Protocol?:tcp~ --dport ~DestinationPort?:~ -j ~Action?:ACCEPT~
  64. exec:_Remove
  65. menu:sending
  66. show:_Mangle,OUTPUT(Local host)::output-mangle
  67. show:_NAT (Local host)::output-nat
  68. show:_Filter,OUTPUT(Local host)::output-filter
  69. show:_NAT,POSTROUTING(Local + Forwarded)::postrouting-nat
  70. menu:output-mangle
  71. exec:_List:disp:iptables -t mangle --list-rules OUTPUT
  72. exec:_Insert::
  73. exec:_Remove::
  74. menu:output-nat
  75. exec:_List rules:disp:iptables -t nat --list-rules
  76. exec:_List OUTPUT:disp:iptables -t nat -L OUTPUT --line-numbers
  77. exec:_List All:disp:iptables -t nat -L --line-numbers
  78. exec:_Insert::
  79. exec:_Remove::
  80. menu:output-filter
  81. exec:_List:disp:iptables -t filter -L OUTPUT --line-numbers
  82. exec:_Insert::
  83. exec:_Remove::
  84. menu:postrouting-nat
  85. exec:_List All:disp:iptables -t nat -L --line-numbers
  86. exec:_List POSTROUTING:disp:iptables -t nat -L POSTROUTING --line-numbers
  87. exec:_Insert::
  88. exec:_Remove::
  89.  
  90. menu:filter:Filter
  91. exec:_List rules:edit,disp:iptables -t filter --list-rules ~Chain?:~
  92. exec:_List:edit,disp:iptables -t filter --list ~Chain?:~
  93. exec:_Append::dialog --menu Protocol: 20 40 17 all o tcp o udp o udplite o icmp o esp o ah o sctp o;\
  94. dialog --form Details 20 60 17 \
  95. "Source address/mask " 1 1 "" 1 28 30 0 \
  96. "Destination address/mask " 2 1 "" 2 28 30 0 \
  97. "Jump target " 3 1 "" 3 28 30 0 \
  98. "Goto chain " 4 1 "" 4 28 30 0 \
  99. "In interface " 5 1 "" 5 28 30 0 \
  100. "Out interface " 6 1 "" 6 28 30 0;\
  101. iptables --append
  102. exec:_Delete::
  103. exec:_Insert::
  104. exec:_Replace::
  105. exec:_Chain..::
  106. menu:mangle:Mangle
  107. exec:_List rules:edit,disp:iptables -t mangle --list-rules ~Chain?:~
  108. exec:_List:edit,disp:iptables -t mangle --list ~Chain?:PREROUTING~
  109. exec:_Add::
  110. exec:_Edit::
  111. exec:_Remove::
  112. exec:_View::
  113. menu:nat
  114. exec:_List rules:disp,edit:iptables -t nat --list-rules ~Chain?:~
  115. exec:_List:disp,edit:iptables -t nat -L ~Chain?:~ --line-numbers
  116. menu:raw
  117. exec:_List rules:disp,edit:iptables -t nat --list-rules ~Chain?:~
  118. exec:_List:disp,edit:iptables -t nat -L ~Chain?:~ --line-numbers
  119. menu:iptables-help:Help
  120. exec:_About:disp:grep "^##" /usr/local/bin/pdmenu.iptables
  121. exec:_iptables::man iptables
  122. exec:_iptables-save::man iptables-save
  123. exec:_Version:disp:iptables --version
  124. nop
  125. exit:_Back to main menu..
RAW Paste Data