Re: How to obtain a new wireless host's IP address?
Pankaj Godbole <[email protected]>
| Newsgroups | gmane.network.nocat |
|---|---|
| Message-ID | <[email protected]> |
Thanks for the quick reply! Yes, this had occured to me after SDE suggested it earlier. So, does this mean that access.fw is explicitly called by NoCatSplash everytime a new user tries to surf the Net? Thanks, again. Pankaj. On Mon, 15 Nov 2004 20:35:57 -0700, Scott C. Lemon <[email protected]> wrote: > Oops ... I posted the wrong access.fw ... It's this one: > > ============================================== > #!/bin/sh > > ## > # VERY simple access control script for leeenux > ## > > # Note: your PATH is inherited from the gateway process > # > > action=$1 > mac=$2 > ip=$3 > class=$4 > > if [ -z "$action" -o -z "$mac" -o -z "$ip" -o -z "$class" ]; then > echo Usage: $0 [permit\|deny] [MAC] [IP] [Class] > echo Example: $0 permit 00:02:2d:aa:bb:cc 10.0.0.105 member > exit 1 > fi > > if [ "$action" = "permit" ]; then > cmd=-A > elif [ "$action" = "deny" ]; then > cmd=-D > else > echo "FATAL: Bad action: $action!" > exit 1 > fi > > if [ "$class" = "Owner" ]; then > mark=1 > elif [ "$class" = "Member" ]; then > mark=2 > elif [ "$class" = "Public" ]; then > mark=3 > else > echo "FATAL: Bad class: $class!" > exit 1 > fi > > # Mark outbound traffic from this node. > iptables -t mangle $cmd NoCat -m mac --mac-source $mac -s $ip -j MARK > --set-mark $mark > > # Mark inbound traffic to this node. > iptables -t filter $cmd NoCat_Inbound -d $ip -j ACCEPT > > # > # Ende > # > ============================================== > > Again ... It appears to be very simple ... You could even execute other apps > > > ... > > Scott C. Lemon > > -----Original Message----- > From: [email protected] [mailto:[email protected]] > On Behalf Of Scott C. Lemon > Sent: Monday, November 15, 2004 8:28 PM > To: 'Pankaj Godbole'; [email protected] > Subject: RE: [NoCat] How to obtain a new wireless host's IP address? > > Ok ... I'm going to take a shot at this ... ;-) > > Looking at the various *.fw files, you will see that they are all just shell > scripts. You ought to be able to edit the access.fw script, and simply add > a statement to output the IP address parameter ($3?) to any other file, etc. > that you like. > > Access.fw appears to look like: > > ================================================== > #!/bin/sh > > # Note: your PATH is inherited from the gateway process > # > > usage="Usage: $0 [permit|deny] [MAC] [IP] [Class]" > action=$1 > mac=$2 > ip=$3 > class=$4 > > if [ "$action" == "permit" ]; then > cmd="-A" > elif [ "$action" == "deny" ]; then > cmd="-D" > else > echo $usage > exit 1 > fi > > if [ -z "$ip" ]; then > echo $usage > exit 1 > fi > > iptables -t nat $cmd NoCat_OK -j ACCEPT > ================================================== > > As you can see, it ought to be easy to just add a line to output any of the > parms that you want to ... > > Scott C. Lemon > > -----Original Message----- > From: [email protected] [mailto:[email protected]] > On Behalf Of Pankaj Godbole > Sent: Monday, November 15, 2004 7:15 PM > To: [email protected] > Subject: Re: [NoCat] How to obtain a new wireless host's IP address? > > Thanks! > > I am facing a couple of problems: > > 1) I'm using NoCatSplash which is written in C and so can't patch a Perl > script to it. Is there a C equivalent? > 2) It appears that I would have to run access.fw explicitly. > > I am wondering if there's a simple way to just have NoCatSplash itself send > a notification to stdout (or better yet a text file) with a new user's > MAC/IP addresses, apart from updating the IPTables? > > I agree that just reading the IP tables would be a straightforward way. But > this would be a bit cumbersome for me since it would require my application > to sit in a loop periodically querying the IP tables, and afterwards update > a text file with the new info. > > Any help would be appreciated! > > Thanks, > Pankaj. > > On Mon, 15 Nov 2004 09:24:44 -0500, Bernie O'Connor <[email protected]> > wrote: > > > > See this thread that refers to the userlog patch: > > > > http://lists.nocat.net/pipermail/nocat/2003-December/004067.html > > > > The patch and description is here: > > http://www.usegroup.de/software/nocat/ > > > > bernie > > > > > > > > -----Original Message----- > > From: [email protected] > > [mailto:[email protected]] On Behalf Of Pankaj Godbole > > Sent: Friday, November 12, 2004 9:33 PM > > To: [email protected] > > Subject: [NoCat] How to obtain a new wireless host's IP address? > > > > Hi All, > > > > I have a question regarding NoCatSplash. For a service that I am > > developing for wireless clients, I need to obtain a new wireless > > host's IP address or MAC address immediately after he/she is > > authenticated. > > > > My question is: Is there a way to obtain address information from > > NoCatSplash without having to modify the source code? E.g. does > > NoCatSplash update a text file with this information? If not, can I > > somehow get NoCatSplash to run my own script to obtain the address > > info., as soon as the user is authenticated? Please help. > > > > Thanks, > > Pankaj. > > _______________________________________________ > > NoCat mailing list > > [email protected] http://lists.nocat.net/mailman/listinfo/nocat > > _______________________________________________ > > NoCat mailing list > > [email protected] http://lists.nocat.net/mailman/listinfo/nocat > > > _______________________________________________ > NoCat mailing list > [email protected] http://lists.nocat.net/mailman/listinfo/nocat > > _______________________________________________ > NoCat mailing list > [email protected] http://lists.nocat.net/mailman/listinfo/nocat > >