SlideShare una empresa de Scribd logo
1 de 12
Iptables
Advanced..
Content
• Iptables
• Packet’s journey
• xtables
• Rules
• DHCP
• DHCP events
• Problem statement
• reference
Packet’s journey
Xtables
• “Xtables-addons is the successor to patch-o-
matic(-ng). Likewise, it contains extensions
that were not accepted in the main iptables
package
• no patches (.diff files) or POM trees
• extensions built as modules
• no reboot, instant use – also perfect for
development
Xtables cont..
• Download the xtables-addons
• Extract the tar file and edit the mconfig file to
install the iptable module you want
• Just do configure ,make and make install as
per INSTALL file
• Geoip,string,ipp2p,TARPIT,pknock
Rules
• iptables -A PREROUTING -t nat -i eth0 --dst 204.215.46.78 -p tcp --dport 41234 -
j DNAT --to 10.12.12.1:3389 –j LOG –log-level 4
• iptables --table nat -A POSTROUTING -o eth0 --src 10.23.0.0/16 --dst
125.11.158.211 -p tcp --dport 3389 -j SNAT --to-source 204.215.46.78
• Iptables --table filter -A INPUT -p tcp --src 10.10.11.11 --sport 1024:65535 --dst
10.10.0.11 --dport 22 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
• Iptables --table filter -A OUTPUT -p tcp --src 10.10.0.11 --sport 22 --dst
10.10.0.11 --dport 1024:65535 -m state --state ESTABLISHED,RELATED -j ACCEPT
• iptables -A PREROUTING -t mangle -i eth0 --src 10.10.0.10/16 -p tcp --dport 443
-j MARK --set-mark 2
Rules cont..
• iptables -A INPUT -p tcp -m pknock --knockports
4002,4001,4004 –strict --name SSH --time 10 --autoclose 60 --
dport 22 -j ACCEPT
• iptables -A FORWARD -t mangle -m ipp2p --bit --kazaa --edk --
dc –gnu –winmx --ares -j DROP
• iptables -A FORWARD -m geoip --src-cc CN --dst
187.78.0.90/24 -j DROP
• Iptables -A BLACKLIST -p tcp -d 10.0.10.11 --sport 443 -m time
--timestart 10:01 --timestop 07:59 --weekdays
Mon,Tue,Wed,Thu,Fri,Sat,Sun -m string --string “facebook" --
algo kmp -j DROP
DHCP
DHCP Events
• Commit
server has made a commitment of a
certain lease to a client
• Release
client has released the server from its
commitment
• Expiry
commitment expires
DHCP configuration
• on commit { set ClientIP = binary-to-ascii(10, 8, ".", leased-
address); execute("/home/commitip",ClientIP); }
• on release { set ClientIP = binary-to-ascii(10, 8, ".", leased-
address); execute("/home/releaseip",ClientIP); }
• on expiry { set ClientIP = binary-to-ascii(10, 8, ".", leased-
address); execute("/etc/rc5.d/expiryip",ClientIP); }
• Jun 18 09:48:39 dhcp dhcpd: execute_statement argv[0] = /home/commitip
Jun 18 09:48:39 dhcp dhcpd: execute_statement argv[1] = 192.168.34.67
Scripts..
Commit
• #!/bin/bash
iptables -L -n|grep -irw "$1"
z=$?
if [ $z -eq 0 ]
then
echo "nothing to add" >> /tmp/error
else
iptables -I FORWARD 1 --src 0.0.0.0/0 --dst $1 -j ACCEPT
Expire
#!/bin/bash
iptables -D FORWARD --src 0.0.0.0/0 --dst $1 -j ACCEPT
Reference
• http://www.linuxwizard.org/centos/xtables-addons-centos-6-iptables-geoip-
filtering/
• http://www.ipp2p.org/docu_en.html
• https://github.com/tinti/xtables-
addons/blob/master/extensions/pknock/libxt_pknock.man
• http://jpmens.net/2011/07/06/execute-a-script-when-isc-dhcp-hands-out-a-new-
lease/
• Siju Thomas

Más contenido relacionado

La actualidad más candente

CETH for XDP [Linux Meetup Santa Clara | July 2016]
CETH for XDP [Linux Meetup Santa Clara | July 2016] CETH for XDP [Linux Meetup Santa Clara | July 2016]
CETH for XDP [Linux Meetup Santa Clara | July 2016]
IO Visor Project
 

La actualidad más candente (19)

Introduction to the Cluster Infrastructure and the Systems Provisioning Engin...
Introduction to the Cluster Infrastructure and the Systems Provisioning Engin...Introduction to the Cluster Infrastructure and the Systems Provisioning Engin...
Introduction to the Cluster Infrastructure and the Systems Provisioning Engin...
 
Dynamic Hadoop Clusters
Dynamic Hadoop ClustersDynamic Hadoop Clusters
Dynamic Hadoop Clusters
 
Multihomed Linux router
Multihomed Linux routerMultihomed Linux router
Multihomed Linux router
 
Scaling with Python: SF Python Meetup, September 2017
Scaling with Python: SF Python Meetup, September 2017Scaling with Python: SF Python Meetup, September 2017
Scaling with Python: SF Python Meetup, September 2017
 
OpenStack Icehouse Over IPv6
OpenStack Icehouse Over IPv6OpenStack Icehouse Over IPv6
OpenStack Icehouse Over IPv6
 
Performance optimization 101 - Erlang Factory SF 2014
Performance optimization 101 - Erlang Factory SF 2014Performance optimization 101 - Erlang Factory SF 2014
Performance optimization 101 - Erlang Factory SF 2014
 
Stress your DUT
Stress your DUTStress your DUT
Stress your DUT
 
CETH for XDP [Linux Meetup Santa Clara | July 2016]
CETH for XDP [Linux Meetup Santa Clara | July 2016] CETH for XDP [Linux Meetup Santa Clara | July 2016]
CETH for XDP [Linux Meetup Santa Clara | July 2016]
 
Debugging Distributed Systems - Velocity Santa Clara 2016
Debugging Distributed Systems - Velocity Santa Clara 2016Debugging Distributed Systems - Velocity Santa Clara 2016
Debugging Distributed Systems - Velocity Santa Clara 2016
 
Troubleshooting containerized triple o deployment
Troubleshooting containerized triple o deploymentTroubleshooting containerized triple o deployment
Troubleshooting containerized triple o deployment
 
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our ServersHTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
 
Accelerating Neutron with Intel DPDK
Accelerating Neutron with Intel DPDKAccelerating Neutron with Intel DPDK
Accelerating Neutron with Intel DPDK
 
Introduction to SLURM
Introduction to SLURMIntroduction to SLURM
Introduction to SLURM
 
High Performance Erlang - Pitfalls and Solutions
High Performance Erlang - Pitfalls and SolutionsHigh Performance Erlang - Pitfalls and Solutions
High Performance Erlang - Pitfalls and Solutions
 
Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016
 
Ceph on arm64 upload
Ceph on arm64   uploadCeph on arm64   upload
Ceph on arm64 upload
 
Linux16 RPM
Linux16 RPMLinux16 RPM
Linux16 RPM
 
Introduction to Stacki at Atlanta Meetup February 2016
Introduction to Stacki at Atlanta Meetup February 2016Introduction to Stacki at Atlanta Meetup February 2016
Introduction to Stacki at Atlanta Meetup February 2016
 
Automated Deployment & Benchmarking with Chef, Cobbler and Rally for OpenStack
Automated Deployment & Benchmarking with Chef, Cobbler and Rally for OpenStackAutomated Deployment & Benchmarking with Chef, Cobbler and Rally for OpenStack
Automated Deployment & Benchmarking with Chef, Cobbler and Rally for OpenStack
 

Similar a Iptables

Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)
Ontico
 

Similar a Iptables (20)

How to convert your Linux box into Security Gateway - Part 1
How to convert your Linux box into Security Gateway - Part 1How to convert your Linux box into Security Gateway - Part 1
How to convert your Linux box into Security Gateway - Part 1
 
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThe Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
 
CCNP Data Center Centralized Management Automation
CCNP Data Center Centralized Management AutomationCCNP Data Center Centralized Management Automation
CCNP Data Center Centralized Management Automation
 
Jesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture OverviewJesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture Overview
 
OSインストーラーの自作方法
OSインストーラーの自作方法OSインストーラーの自作方法
OSインストーラーの自作方法
 
The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016
 
Day 20.i pv6 lab
Day 20.i pv6 labDay 20.i pv6 lab
Day 20.i pv6 lab
 
Juniper Network Automation for KrDAG
Juniper Network Automation for KrDAGJuniper Network Automation for KrDAG
Juniper Network Automation for KrDAG
 
Nagios Conference 2014 - Leland Lammert - Distributed Heirarchical Nagios
Nagios Conference 2014 - Leland Lammert - Distributed Heirarchical NagiosNagios Conference 2014 - Leland Lammert - Distributed Heirarchical Nagios
Nagios Conference 2014 - Leland Lammert - Distributed Heirarchical Nagios
 
Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
 
Implementation of DNS Anycast - a case study
Implementation of DNS Anycast - a case studyImplementation of DNS Anycast - a case study
Implementation of DNS Anycast - a case study
 
Byte blower basic setting full_v2
Byte blower basic setting full_v2Byte blower basic setting full_v2
Byte blower basic setting full_v2
 
MAGPI: Advanced Services: IPv6, Multicast, DNSSEC
MAGPI: Advanced Services: IPv6, Multicast, DNSSECMAGPI: Advanced Services: IPv6, Multicast, DNSSEC
MAGPI: Advanced Services: IPv6, Multicast, DNSSEC
 
PLNOG16: ZTP – Zero Touch Provisioning in use, Marek Plaza
PLNOG16: ZTP – Zero Touch Provisioning in use, Marek PlazaPLNOG16: ZTP – Zero Touch Provisioning in use, Marek Plaza
PLNOG16: ZTP – Zero Touch Provisioning in use, Marek Plaza
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby Systems
 
Apnic IPv6 Deployment
Apnic IPv6 DeploymentApnic IPv6 Deployment
Apnic IPv6 Deployment
 
Pcapy and dpkt - tcpdump on steroids - Ran Leibman - DevOpsDays Tel Aviv 2018
Pcapy and dpkt - tcpdump on steroids - Ran Leibman - DevOpsDays Tel Aviv 2018Pcapy and dpkt - tcpdump on steroids - Ran Leibman - DevOpsDays Tel Aviv 2018
Pcapy and dpkt - tcpdump on steroids - Ran Leibman - DevOpsDays Tel Aviv 2018
 
Dave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical ExperienceDave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical Experience
 
ChinaNetCloud Online Lecture:Something About Tshark
ChinaNetCloud Online Lecture:Something About TsharkChinaNetCloud Online Lecture:Something About Tshark
ChinaNetCloud Online Lecture:Something About Tshark
 

Último

Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 

Último (20)

Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
 
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 

Iptables

  • 2. Content • Iptables • Packet’s journey • xtables • Rules • DHCP • DHCP events • Problem statement • reference
  • 4. Xtables • “Xtables-addons is the successor to patch-o- matic(-ng). Likewise, it contains extensions that were not accepted in the main iptables package • no patches (.diff files) or POM trees • extensions built as modules • no reboot, instant use – also perfect for development
  • 5. Xtables cont.. • Download the xtables-addons • Extract the tar file and edit the mconfig file to install the iptable module you want • Just do configure ,make and make install as per INSTALL file • Geoip,string,ipp2p,TARPIT,pknock
  • 6. Rules • iptables -A PREROUTING -t nat -i eth0 --dst 204.215.46.78 -p tcp --dport 41234 - j DNAT --to 10.12.12.1:3389 –j LOG –log-level 4 • iptables --table nat -A POSTROUTING -o eth0 --src 10.23.0.0/16 --dst 125.11.158.211 -p tcp --dport 3389 -j SNAT --to-source 204.215.46.78 • Iptables --table filter -A INPUT -p tcp --src 10.10.11.11 --sport 1024:65535 --dst 10.10.0.11 --dport 22 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT • Iptables --table filter -A OUTPUT -p tcp --src 10.10.0.11 --sport 22 --dst 10.10.0.11 --dport 1024:65535 -m state --state ESTABLISHED,RELATED -j ACCEPT • iptables -A PREROUTING -t mangle -i eth0 --src 10.10.0.10/16 -p tcp --dport 443 -j MARK --set-mark 2
  • 7. Rules cont.. • iptables -A INPUT -p tcp -m pknock --knockports 4002,4001,4004 –strict --name SSH --time 10 --autoclose 60 -- dport 22 -j ACCEPT • iptables -A FORWARD -t mangle -m ipp2p --bit --kazaa --edk -- dc –gnu –winmx --ares -j DROP • iptables -A FORWARD -m geoip --src-cc CN --dst 187.78.0.90/24 -j DROP • Iptables -A BLACKLIST -p tcp -d 10.0.10.11 --sport 443 -m time --timestart 10:01 --timestop 07:59 --weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun -m string --string “facebook" -- algo kmp -j DROP
  • 9. DHCP Events • Commit server has made a commitment of a certain lease to a client • Release client has released the server from its commitment • Expiry commitment expires
  • 10. DHCP configuration • on commit { set ClientIP = binary-to-ascii(10, 8, ".", leased- address); execute("/home/commitip",ClientIP); } • on release { set ClientIP = binary-to-ascii(10, 8, ".", leased- address); execute("/home/releaseip",ClientIP); } • on expiry { set ClientIP = binary-to-ascii(10, 8, ".", leased- address); execute("/etc/rc5.d/expiryip",ClientIP); } • Jun 18 09:48:39 dhcp dhcpd: execute_statement argv[0] = /home/commitip Jun 18 09:48:39 dhcp dhcpd: execute_statement argv[1] = 192.168.34.67
  • 11. Scripts.. Commit • #!/bin/bash iptables -L -n|grep -irw "$1" z=$? if [ $z -eq 0 ] then echo "nothing to add" >> /tmp/error else iptables -I FORWARD 1 --src 0.0.0.0/0 --dst $1 -j ACCEPT Expire #!/bin/bash iptables -D FORWARD --src 0.0.0.0/0 --dst $1 -j ACCEPT
  • 12. Reference • http://www.linuxwizard.org/centos/xtables-addons-centos-6-iptables-geoip- filtering/ • http://www.ipp2p.org/docu_en.html • https://github.com/tinti/xtables- addons/blob/master/extensions/pknock/libxt_pknock.man • http://jpmens.net/2011/07/06/execute-a-script-when-isc-dhcp-hands-out-a-new- lease/ • Siju Thomas

Notas del editor

  1. Same idea, different implementation.
  2. Adding new dimensions to iptables
  3. Can use excpet india
  4. No management of IP required..renewal process,expire process
  5. DDNS updates
  6. Can also get the mac address
  7. Can also be used for mac address
  8. cat /proc/net/ip_tables_matches