PtokaX forum

PtokaX => Support => Topic started by: DuckHuntINPro on 10 November, 2004, 23:36:55

Title: DNS Help?
Post by: DuckHuntINPro on 10 November, 2004, 23:36:55
Hey guys, I was just wondering.....I need to only allow people to connect to my ptokax server that are on my campus.  Is there a way to only allow people with a certain/multiple specified DNS(s) to connect? for example resnet.indiana.edu or something? thanks
Title:
Post by: bastya_elvtars on 10 November, 2004, 23:52:35
there should be a pinger out, but hmmm what is the ip range?
Title:
Post by: DuckHuntINPro on 11 November, 2004, 00:13:02
ok, i found out that i need to only allow people with IP's that start with 128.211.###.### to connect.....my campus designates all its connections to start with 128.211   so like i said, as long as the persons ip starts with 128.211 the last 2 slots ###.### are assigned dynamically of course.  How can i make sure this works? and if you tell me code, where does this code go? and can you make an error response to say something like "you are not on a campus connection, you are not allowed in" to show up? thanks
Title:
Post by: bastya_elvtars on 11 November, 2004, 15:52:52
Simplicity owns!

-- made by bastya_elvtars for DuckHuntINPro

iptostartwith="128.211." --

function NewUserConnected(user)
if strsub(user.sIP,1,8)~=iptostartwith then
user:SendData("ipchk","this is a private hub")
user:Disconnect()
end
end
Title:
Post by: DuckHuntINPro on 11 November, 2004, 19:10:50
well, i tried mutors script and it works fine so far, except i ran into another problem.   the script seems to be checking the internal ip, not the external.  when i say internal i mean that if the person is connected behind a router even fi they are on the 128.211 it won't let them connect.  is there a way to fix the script so it checks the external (world) ip, not what the actual computer is sitting on?