Sponsored Content
Full Discussion: telnet issues
Top Forums UNIX for Dummies Questions & Answers telnet issues Post 29077 by cbkihong on Monday 30th of September 2002 12:39:40 AM
Old 09-30-2002
A packet filtering firewall filters packets passing through by examining the fields of the packet, and you set up rules to decide how to deal with packets satisfying certain rules you defined.

You can set up a firewall with a rule stating something like "packets destined to port 23 whose IP is not in 100.100.100.1-10 range should be dropped.". Packets matching this rule will be dropped at the firewall before having the chance of reaching the telnet daemon.

On Linux, ipchains or iptables does exactly that. There are similar tools in other Unix variants.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

telnet

hello there! :) i'm a newbie here...and i have a question, how can you logout while you're chatting in commode? thanx! :) (2 Replies)
Discussion started by: hapiworm
2 Replies

2. UNIX for Dummies Questions & Answers

getting on to telnet

how can I get on to telnet keep getting the page cant be found:confused: (1 Reply)
Discussion started by: tamworther
1 Replies

3. UNIX for Advanced & Expert Users

Telnet

Hi, When we use telnet (from unix workstation or windows) to remotely access the Unix server, the environment variables such as: DISPLAY, TERM, LOGNAME are communicate to the telnet server during the telnet session negotiation. By default these variables are passed to the server. We can... (1 Reply)
Discussion started by: vtran4270
1 Replies

4. Shell Programming and Scripting

SU issues

Hi, I have automated a build process that does the following activities. 1. check out code from cvs to a specific directory 2. build the revision checked out with 'ANT' 3. integrate the compiled code with the QA/UAT or new environment (/apps/QA or /apps/UAT or /apps/new directory) I... (1 Reply)
Discussion started by: yoi2hot4ya
1 Replies

5. Shell Programming and Scripting

Webpage to Telnet via Perl and Expect: Telnet problem?

Somewhat long story: I have a simple Perl CGI script that uses Expect to Telnet to a device and grab some data, and then spits it back to Perl for display on the Webpage. This works for many devices I've tried, but one device just fails, it keeps rejecting the password on this device, only... (1 Reply)
Discussion started by: jondo
1 Replies

6. Shell Programming and Scripting

Telnet Script Issues

HI All Some body wrote to me this Telnet Script : #!/opt/perl/bin/perl $ip = $ARGV; die ("IP must be passed as an argument. $!\n") unless defined($ip); use Net::Telnet (); $handle = new Net::Telnet (Timeout => 10, Prompt => '/.*(#|>|\))\s*$/'); $handle->open("$ip");... (10 Replies)
Discussion started by: Darknight
10 Replies

7. OS X (Apple)

Telnet help.

I wanted to learn Telnet protocol so I read an RFC-854 on telnet but now i'm kinda stuck ...where to go now???? Need guidance from you guys...about some website or any resources that could help to learn more about it. (1 Reply)
Discussion started by: jFreak619
1 Replies

8. Emergency UNIX and Linux Support

rm -rf issues

We are using the solaris server and if i am using rm -rf to delete the directories its asking the confirmation for each and every file inside the directory.Is there any way to disable ( should not ask the confirmation) only for a particular session? (12 Replies)
Discussion started by: sureshbabuc
12 Replies

9. UNIX for Dummies Questions & Answers

Automatically login in the telnet from present telnet

Hi, I was writing one script which includes to switch to the another telnet automatically from the present telnet server. I was using rlogin but firstly it takes the same user name of the present telnet and secondly it is prompting for the password. But i want to switch to the another telnet... (2 Replies)
Discussion started by: Prateek
2 Replies

10. UNIX for Dummies Questions & Answers

Difference Between Krb5-telnet And Ekrb5-telnet

Hi, I want to know the difference between these two services. Both are under xinetd. Both are used for enabling and disabling Telnet service. So, can somebody please explain me the difference between the two ? Thanks in advance :) (0 Replies)
Discussion started by: kashifsd17
0 Replies
DIVERT(4)						   BSD Kernel Interfaces Manual 						 DIVERT(4)

NAME
divert -- kernel packet diversion mechanism SYNOPSIS
#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> int socket(PF_INET, SOCK_RAW, IPPROTO_DIVERT); DESCRIPTION
Divert sockets are similar to raw IP sockets, except that they can be bound to a specific divert port via the bind(2) system call. The IP address in the bind is ignored; only the port number is significant. A divert socket bound to a divert port will receive all packets diverted to that port by some (here unspecified) kernel mechanism(s). Packets may also be written to a divert port, in which case they re- enter kernel IP packet processing. Divert sockets are normally used in conjunction with FreeBSD's packet filtering implementation and the ipfw(8) program. By reading from and writing to a divert socket, matching packets can be passed through an arbitrary ``filter'' as they travel through the host machine, special routing tricks can be done, etc. READING PACKETS
Packets are diverted either as they are ``incoming'' or ``outgoing.'' Incoming packets are diverted after reception on an IP interface, whereas outgoing packets are diverted before next hop forwarding. Diverted packets may be read unaltered via read(2), recv(2), or recvfrom(2). In the latter case, the address returned will have its port set to the some tag supplied by the packet diverter, (usually the ipfw rule number) and the IP address set to the (first) address of the inter- face on which the packet was received (if the packet was incoming) or INADDR_ANY (if the packet was outgoing). In the case of an incoming packet the interface name will also be placed in the 8 bytes following the address, (assuming it fits). WRITING PACKETS
Writing to a divert socket is similar to writing to a raw IP socket; the packet is injected ``as is'' into the normal kernel IP packet pro- cessing and minimal error checking is done. Packets are written as either incoming or outgoing: if write(2) or send(2) is used to deliver the packet, or if sendto(2) is used with a destination IP address of INADDR_ANY, then the packet is treated as if it were outgoing, i.e., destined for a non-local address. Otherwise, the packet is assumed to be incoming and full packet routing is done. In the latter case, the IP address specified must match the address of some local interface, or an interface name must be found after the IP address. If an interface name is found, that interface will be used and the value of the IP address will be ignored (other than the fact that it is not INADDR_ANY). This is to indicate on which interface the packet ``arrived.'' Normally, packets read as incoming should be written as incoming; similarly for outgoing packets. When reading and then writing back pack- ets, passing the same socket address supplied by recvfrom(2) unmodified to sendto(2) simplifies things (see below). The port part of the socket address passed to the sendto(2) contains a tag that should be meaningful to the diversion module. In the case of ipfw(8) the tag is interpreted as the rule number after which rule processing should restart. LOOP AVOIDANCE
Packets written into a divert socket (using sendto(2)) re-enter the packet filter at the rule number following the tag given in the port part of the socket address, which is usually already set at the rule number that caused the diversion (not the next rule if there are several at the same number). If the 'tag' is altered to indicate an alternative re-entry point, care should be taken to avoid loops, where the same packet is diverted more than once at the same rule. DETAILS
To enable divert sockets, your kernel must be compiled with the option IPDIVERT. If a packet is diverted but no socket is bound to the port, or if IPDIVERT is not enabled in the kernel, the packet is dropped. Incoming packet fragments which get diverted are fully reassembled before delivery; the diversion of any one fragment causes the entire packet to get diverted. If different fragments divert to different ports, then which port ultimately gets chosen is unpredictable. Packets are received and sent unchanged, except that packets read as outgoing have invalid IP header checksums, and packets written as outgo- ing have their IP header checksums overwritten with the correct value. Packets written as incoming and having incorrect checksums will be dropped. Otherwise, all header fields are unchanged (and therefore in network order). Binding to port numbers less than 1024 requires super-user access, as does creating a socket of type SOCK_RAW. ERRORS
Writing to a divert socket can return these errors, along with the usual errors possible when writing raw packets: [EINVAL] The packet had an invalid header, or the IP options in the packet and the socket options set were incompatible. [EADDRNOTAVAIL] The destination address contained an IP address not equal to INADDR_ANY that was not associated with any interface. SEE ALSO
bind(2), recvfrom(2), sendto(2), socket(2), ipfw(8) BUGS
This is an attempt to provide a clean way for user mode processes to implement various IP tricks like address translation, but it could be cleaner, and it's too dependent on ipfw(8). It's questionable whether incoming fragments should be reassembled before being diverted. For example, if only some fragments of a packet destined for another machine don't get routed through the local machine, the packet is lost. This should probably be a settable socket option in any case. AUTHORS
Archie Cobbs <archie@FreeBSD.org>, Whistle Communications Corp. BSD
June 18, 1996 BSD
All times are GMT -4. The time now is 01:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy