Iptables rules – Access by MAC and redirect



Hello

I am new here and i want to say Hi to Everybody!

And I have a questions. I want to write Linux firewall iptables rules.
I want to block internet access to all users and allow by MAC
addresses. Oh and when someone isn’t on access list to redirect him to
web page with information.

I start writing rules:

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -F
iptables -X
iptables -t nat -X
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P FORWARD DROP

iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -j MASQUERADE

iptables -A FORWARD -m mac --mac-source 00:1F:D0:0D:4A:5A -j ACCEPT
iptables -A FORWARD -j ACCEPT -m state --state RELATED,ESTABLISHED

but I don’t know how to redirect blocked users to web page
information.

All the best
TomTom
.



Relevant Pages

  • Re: Squid as default gateway in proxy mode.
    ... the console and ping. ... NAT only ICMP Echo Rep and Req so that i can at least ping outside ... control over traffic with IPtables firewall. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: setting up nat
    ... graphical firewall config tools on FC don't do NAT. ... You should realise that netfilter rules applied using the 'iptables' ...
    (Fedora)
  • Re: [9fans] Do we have a catalog of 9P servers?
    ... iptables on Linux needs to keep in order to provide NAT capabilities it ... You seem to be extremely out of the field with respect to what iptables does and how normal NAT is implemented on a *BSD system. ... do any of you 9fans have an internal network behind a gateway that runs Plan 9? ...
    (comp.os.plan9)
  • MDKSA-2002:030 - temporary fix for netfilter information leak
    ... (NAT) ... It was found that iptables can leak information ... You can view other update advisories for Mandrake Linux at: ... pub 1024D/22458A98 2000-07-10 Linux Mandrake Security Team ...
    (Bugtraq)
  • Re: internet connection sharing.
    ... Ummm IPTABLES??? ... script that sets up NAT and does just this. ... > What I would like to do is to change my computer back to RedHat, ...
    (RedHat)