![]() CEG
499/699:
|
|
| 04/05/01 |
ping,
traceroute, ifconfig, route. ssh.dmesg, modprobe, ifconfig, route, etc.
The Linux kernel you will be booting is modularized. Only the must-have
modules are linked together into the kernel. All other modules are
dynamically loaded as needed. The command lsmod lists the
modules currently loaded. The command dmesg re-displays the
boot messages which contain identification strings of various devices that the
kernel has detected.
As of MAr 2001, our lab PCs have a built-in NIC, a 100Mb/s 3Com 905B (physically the top one, Linux driver module name 3c59x), and another NIC (near the bottom) 10 Mb/s, either 3Com 509 (driver module name 3c509), or Linksys (driver module tulip).
ifconfig
(called ipconfig in NT) assigns the IP address and sets other
parameters. It can also show the current settings; here is an
example. Read the man pages etc, and learn the meaning every piece of data
shown.
eth0 Link encap:Ethernet HWaddr 00:C0:4F:79:34:6B
inet addr:192.168.17.112 Bcast:192.168.17.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:553667 errors:0 dropped:0 overruns:0 frame:0
TX packets:805490 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:19 Base address:0xec00
eth1 Link encap:Ethernet HWaddr 00:20:AF:D8:37:53
inet addr:130.108.17.112 Bcast:130.108.17.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4281174 errors:11 dropped:0 overruns:0 frame:11
TX packets:704655 errors:0 dropped:0 overruns:0 carrier:2
collisions:8232 txqueuelen:100
Interrupt:10 Base address:0x300
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:53 errors:0 dropped:0 overruns:0 frame:0
TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
route -n executed on a machine in my office.
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 130.108.17.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 192.168.17.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 130.108.17.1 0.0.0.0 UG 0 0 0 eth1The table can be understood as follows. Consider an IP packet that has a destination IP address of D. We choose the first row in the table above that matches as follows. If D & genmask == Destination in that row, send the packet via the interface shown in that row. [The & is bit-wise-and.] If the gateway entry in that row is non-zero, the address given there is that of the immediately next gateway that packet should be sent to. So, a packet with a destination address of say 192.168.17.45 will be sent out via eth0; a packet with a destination address of 130.108.17.232 will be sent out via eth1; and, finally, a packet with a destination address of 144.32.232.123 is sent out via eth1 because of the last row.
A proxy server (or simply, a proxy) P is a go-between for a client C that wishes to obtain the services of a server S. To the client C, P appears as a server. P receives requests from C. It can apply various rules in deciding whether or not it should get that request honored and or log such requests. P then conveys that request to S as thought the request originated from P. To the server S, P appears as a client. The server S is wholly unaware that the request originated from C.
Secure Shell (SSH) was designed to address these problems by providing a stronger authentication mechanism to identify both hosts and users and to enable secure connections between machines for executing commands and remote shells between them.
The current method of communicating between machines allows anyone to sniff the packets on the network. Passwords and all data are sent along in plain text and can be readily captured and analyzed. Secure shell foils sniffing attempts by encrypting the packets (using ciphers) and by only allowing connections with known machines (using RSA public key technology to authenticate). In general, it never trusts the network. Should an attacker gain root access to your machine through another means, however, SSH can then be compromised also. The encryption method, and indeed whether or not encryption is even turned on, is a settable parameter. Make sure you choose the values that will properly protect your system.
If the remote machine doesn't support ssh it will then fall back to using the r-programs, after first informing the user that the communication will not encrypted. Note that SSH does not protect you from anyone having root access on your local machine or on the server machine. Root on either of these machines could monitor your session or replace programs with Trojans. So basic security on the client and server machines still needs to be maintained.
Objective: Connect four machines (P0 .. P3) in the lab in a chain so that the middle two (P1 and P2) of them will behave like a router and set up the routing tables so as to TCP connect any machine (card) in the LAN with any other machine (card).
dmesg,
modprobe, ifconfig, route, etc. These commands are in the
/sbin directory. So, invoke the following to extend your PATH:export PATH=$PATH:/sbin
dmesg to re-examine the boot
messages.
cat /proc/sys/net/ipv4/ip_forward echo 1 > /proc/sys/net/ipv4/ip_forwardrouted.
ifconfig -a; route| 04/05/01 02:29:22 PM |
| pmateti@cs.wright.edu |