Iptables rules – Access by MAC and redirect


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 -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

All the best

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 ...
  • Re: setting up nat
    ... graphical firewall config tools on FC don't do NAT. ... You should realise that netfilter rules applied using the 'iptables' ...
  • 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? ...
  • 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 ...
  • 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, ...