впервые сказано пользователем belkins 01.03.2009 в 14:23
и с тех пор употреблялось 64
Сообщения со словом
Запрос выполнился за 0.0241
- 09.10.2011, 14:50. .kkursor в теме
«Помогите настроить bind»
... named stats if named is being used only as a local resolver this is a safe default for named to be accessible to the network comment this option specify the proper ip address or delete this option if you have ipv6 enabled on this system uncomment this option for use as a local resolver to give access to the network specify an ipv6 address or the keyword any listen-on-v6 1 these zones are already covered by the empty zones listed below if you remove the related empty zones below comment these lines out disable-empty-zone 255 255 255 255 in-addr arpa in addition to the forwarders clause you can force your name server to never initiate queries of its own but always ask its forwarders only by enabling the following line forward only if you ve got a dns server around at your upstream provider enter its ip address here and enable the line below this will make you benefit from its cache thus reduce overall dns traffic in the internet forwarders 195 178 222 2 79 135 229 194 modern versions of bind use a random udp port for each outgoing query by default in order to dramatically reduce the possibility of cache poisoning all users are strongly encouraged to utilize this feature and to configure their firewalls to accommodate it as a last resort in order to get around a restrictive firewall policy you can try enabling the option below use of this option will significantly reduce your ability to withstand cache poisoning attacks and should be avoided if at all possible query-source address port nnnnn first in your etc resolv conf so this server will be queried also make...
- 19.10.2010, 02:42. ln(x) в теме
«Линукс и мелкомягкие»
... runs the k scripts my subsys dir var lock subsys the resolv confs my resolv etc resolv conf my resolv pptp resolv pptp my resolv real resolv real clean up the path since this is run as root env path bin usr bin usr sbin delete env bash env delete env ifs delete env env sub usage print usage 0 setup stop start tunnel n print all options must be specified to run non-interactively n exit 1 first some support functions that are used everywhere yesno prompt ask the user prompt and return true for yes false for no sub yesno my prompt 0 while 1 print n prompt y n my choice stdin chomp choice return 1 if choice eq choice yy return 0 if choice nn print ni don t understand choice please try again n queryuser prompt default ask the user prompt and return the answer default if cr sub queryuser my prompt default print prompt print default if defined default print my answer stdin chomp answer answer default if answer eq and defined default return answer configuredtunnels returns a list of configured tunnels sub configuredtunnels my tunnels if -d tunnel dir foreach my f cd tunnel dir ls chomp f next if f eq default my p tunnel dir f if p safe re o print unsafe characters in tunnel name p n next p 1 push tunnels f if -f p and grep pptp p return tunnels bselect a rough equilivent of the bourne shell s select sub bselect my prompt shift my choices for my i 0 choices print i 1 choices i n my reply queryuser prompt undef return reply selecttunnel interactive prints 0 as a prompt and returns the choice sub selecttunnel my tunnel my tunnels configuredtunnels while tunnel eq tunnel bselect 0 tunnels return tunnels tunnel 1 if tunnel d return tunnel if grep tunnel tunnels return addtunnel name ip local remote adds a new tunnel with name name server ip address ip and using the chap secret determined by local name local and remote name remote sub addtunnel my name ip local remote routes if -f tunnel dir name print error peer name already exists n return open peer tunnel dir name or die can t open tunnel dir name for writing print peer pptp tunnel configuration for tunnel name server ip ip n foreach my r routes print peer route r n print peer tags for chap secret selection name local remotename remote tunnel name for ip-up local or ip-up d scripts ipparam name include the main pptp configuration file file pppdir options pptp close peer or die can t close tunnel dir name print added tunnel name n deltunnel name deletes the tunnel named name sub deltunnel my name 0 return if defined name name eq if -f tunnel dir name print error peer name does not exist n return force name to be untainted name is clean because it passed the -f test above and it s not being sent to a shell but -t doesn t know that name o name 1 unlink tunnel dir name print removed tunnel name n breaksymlink file if file is a symlink 1 break the link 2 copy the contents of the file pointed to do file sub breaksymlink my file shift if -l file my link readlink file link 1 link if file m and not link m print breaking symlink file link n unlink file die file pointed at a strangely named file n if link safe re link 1 cp link file rotate target new old rotates config files target full path of the config file new full path of the file being rotated in old expected contents of the file being rotated out example rotate etc resolv conf etc resolv conf pptp etc resolv conf real sub rotate my target new old return undef unless -f new -f old my diff diff target new chomp diff return 1 if diff eq diff diff target old chomp diff if diff ne print warning new not installed n print target does not match old n return undef ln -sf new target print installed new as target n return addchaporpap interactive prompts for parameters and adds a chap or pap secret sub addchaporpap my secret type 0 print add a new secret type secret note any backslashes must be doubled local name this is the local identifier for secret type authentication note if the server is a windows nt machine the local name should be your windows nt username including domain for example domain username my local queryuser local name undef print remote name this is the remote identifier for secret type authentication in most cases this can be left as the default it must be set if you have multiple secret type secrets with the same local name and different passwords just press enter to keep the default my remote queryuser remote name pptp print password this is the password or secret type secret for the account specified the password will not be echoed get the password without echoing stty -echo my pass queryuser password undef stty echo my secrets file if secret type eq chap secrets file chap secrets elsif secret type eq pap secrets file pap secrets else die wrong secret type open secrets file secrets file or die couldn t open secrets file print nadding secret local remote password n n print secrets file local t remote t pass t n print secrets file remote t local t pass n close secrets file or die couldn t close secrets file chmod 0600 secrets file addchaporpap addpptp interactive add a new pptp tunnel configuration sub addpptp my name ip local remote print nadd a new pptp tunnel n n my configs keys pptp servers my choice bselect which configuration would you like to use configs other my routes if choice configs 1 while 1 name queryuser tunnel name undef per man perlsec check for special characters if name w name 1 last print name contains special characters n print please use only alphanumerics and n ip queryuser server ip undef print what route s would you like to add when the tunnel comes up n print this is usually a route to your internal network behind the pptp server n print you can use substitution keywords as in etc pptp d config file n print tunnel dev is the tunnel interface n print def gw is the existing default gateway n print iplocal is the local ip address n print ipremote is the remote ip address n print the syntax to use is the same as the route 8 command n print enter a blank line to stop n while 1 my route queryuser route undef last unless defined route last if route eq if route unsafe re o print route contains unsafe characters discarded n next push routes route else name configs choice-1 ip pptp servers configs choice-1 ip routes pptp servers configs choice-1 routes print local name and remote name should match a configured chap or pap secret local name is probably your nt domain username note any backslashes must be doubled local queryuser local name undef remote queryuser remote name pptp print adding name ip local remote n addtunnel name ip local remote routes sub configureresolv if yesno use a pptp-specific resolv conf during tunnel connections if -f resolv pptp print resolv pptp exists n if yesno do you want to use the existing resolv pptp print renaming resolv pptp resolv pptp orig n rename resolv pptp resolv pptp orig or die couldn t rename resolv pptp if -f resolv pptp my configs keys dns servers my choice bselect which configuration do you want to use configs other my addresses search if choice configs 1 print what domain names do you want to search for partially n specified names n print enter all of them on one line seperated by spaces n search queryuser domain names undef print enter the ip addresses of your nameservers n print enter a blank ip address to stop n while 1 my address queryuser nameserver ip address undef last unless defined address last if address eq push addresses address else search dns servers configs choice-1 search list addresses dns servers configs choice-1 ip list open pptp resolv pptp or die couldn t open resolv pptp for writing print pptp search search n foreach my a addresses print pptp nameserver a n close pptp or die couldn t close resolv pptp if -f resolv real my diff diff resolv resolv real chomp diff if diff ne print resolv real exists n print copying it to resolv real orig n unlink resolv real orig rename resolv real resolv real orig breaksymlink resolv print copying resolv to resolv real n cp -f resolv resolv real print creating link from resolv real to resolv n ln -sf resolv real resolv else they choose not to twiddle etc resolv conf breaksymlink resolv if -f resolv pptp print resolv pptp exists n if yesno do you want to delete etc resolv conf pptp unlink resolv pptp print resolv pptp deleted n else print you have chosen not to delete resolv pptp n this existing resolv pptp may still be used n when tunnel connections are established if you n really don t want it to be used you should n rename or remove it n if -f resolv real my diff diff resolv resolv real chomp diff if diff eq print resolv is identical to resolv real n if yesno do you want to delete resolv real unlink resolv real print resolv real deleted n else print resolv and resolv real both exist n but are not the same you should decide which n one is correct and make sure that file is named n resolv n getchaporpap this returns all the chap or pap secrets with ed out the paswords sub getchaporpap my secret type 0 my secrets file if secret type eq chap secrets file chap secrets elsif secret type eq pap secrets file pap secrets else die wrong sercet type if -f secrets file my list cat secrets file foreach my secret list secret s s s s 1 n unless secret s return list else return undef managesecrets this manages secret files sub managesecrets my secret type 0 while 1 my manage task bselect list secret type secrets add a new secret type secret delete a secret type secret quit if manage task eq 1 print current secret type secrets n my list getchaporpap secret type if list print list else print none n elsif manage task eq 2 addchaporpap secret type elsif manage task eq 3 my list my secrets file if secret type eq chap secrets file chap secrets elsif secret type eq pap secrets file pap secrets else die wrong secret type list getchaporpap secret type if list print select one of the pair of lines that you want removed n print both matching lines will be deleted n my choice bselect remove which secret type secret list none choice-- if choice list print aborted deleting a secret type secret n next else stty -echo my passwd queryuser enter the password for this secret type secret undef stty echo my secrets cat secrets file open secrets file secrets file or die couldn t open secrets file for writing my local remote undef split s list choice my count 0 foreach my c secrets my c local c remote c secret undef split s c if c secret eq passwd c local eq local c remote eq remote c local eq remote c remote eq local count next else print secrets file c close secrets file or die couldn t close secrets file after writing print ndeleted count entries print perhaps you mistyped the password if count 0 print n elsif manage task eq 4 manage task eq q last else next setup this is the part that does the old pptp-setup work first the site-specific config files sub setup my name search list ip list ip configs foreach my f ls pptpdir if f safe re o print name your files something reasonable f doesn t qualify n next f 1 open config pptpdir f or next silently fail here configs config close config chomp f for my i 0 i configs i configs i s o if configs i s chomp configs i if configs i eq nameservers until i configs name search list ip list split configs i name f name dns servers name search list search list dns servers name ip list split ip list else name ip split configs i name f name pptp servers name ip ip pptp servers name routes until configs i eq n chomp configs i if configs i unsafe re o print warning the line n configs i n contains unsafe characters n next pptp servers name routes pptp servers name routes configs i ok now all the info from the config files is in pptp servers and dns servers now let s do something with it while 1 my task bselect manage chap secrets manage pap secrets list pptp tunnels add a new pptp tunnel delete a pptp tunnel configure resolv conf select a default tunnel quit if task eq 1 managesecrets chap elsif task eq 2 managesecrets pap elsif task eq 3 my tunnels configuredtunnels print current tunnels n if scalar tunnels 0 print join n tunnels print n else print none n elsif task eq 4 addpptp elsif task eq 5 my tunnel selecttunnel delete which tunnel deltunnel tunnel if tunnel ne elsif task eq 6 configureresolv elsif task eq 7 my tunnels configuredtunnels...
- 08.12.2009, 02:20. Lerk в теме
«Лицензионное VS нелицензионное ПО»
... настраивается конфигурированием etc network interfaces etc resolv conf все в случае с vpn ами и прочей лабудой...
- 01.03.2009, 14:23. belkins в теме
... пишу подскажите плиз код include sys socket h include resolv h include string h int main int argc char argv char buffer 1024 char message 50 struct sockaddr in servaddr cliaddr int sockfd size sizeof servaddr ttl 64 sockfd socket af inet sock dgram 0 bzero servaddr sizeof servaddr servaddr sin family af inet servaddr sin port htons 4544 if inet aton 239 255 13 13 servaddr sin addr s addr 0 inaddr any printf bad ip n if setsockopt sockfd ipproto ip ip multicast ttl u char ttl sizeof int 0 printf error if setsockopt sockfd ipproto ip ip multicast if servaddr size 0 printf error printf enter message scanf 49s message 0 sendto sockfd message sizeof message 0 struct sockaddr servaddr size return 0 а вот сервер код include sys socket h include resolv h include string h include stdio h int main...