BCSL-063 2016-17 session 1. (a) What a shell script that list and delete the files having file size range 0-1 bytes, 1-10 bytes, 10-20 bytes and 20-50 bytes? (10 Marks) Solution: The following command will find all files greater than 0 byte size and less than 1byte size and ask you whether you wish to delete them. find . -size +0k -size -1k -exec rm -i {} \; The following command will find all files greater than 1 byte size and less than 10byte size and ask you whether you wish to delete them. find . -size +1k -size -10k -exec rm -i {} \; The following command will find all files greater than 10 byte size and less than 20byte size and ask you whether you wish to delete them. find . -size +10k -size -20k -exec rm -i {} \; The following command will find all files greater than 20 byte size and less than 50byte size and ask you whether you wish to delete them. find . -size +20k -size -50k -exec rm -i {} \;

1. (b) Configure Windows 2000 Client to use DHCP, DNS, and WINS.

(10 Marks)

Solution: Create a plan Before you configure your DHCP server, it is a good idea to have all your ducks in a row. Prepare and have all the necessary information up front before sitting down and configuring your server. For example, you may need to know:   

The scope of IP addresses that your server will manage (e.g., 192.168.1.50 to 192.168.1.200). Which machines require static IP addresses (i.e., those machines such as servers and routers that will not use DHCP to receive their IP addresses but will be set manually). Which network information you want to send out to DHCP clients when they get their IP addresses (e.g., the addresses for your default gateway, DNS servers, and WINS servers).

It is much easier to configure your DHCP server with this information at hand rather than scrambling for it at implementation time. Installing DHCP Installing DHCP on a Windows 2000 Server or Advanced Server is a fairly simple process. During the installation, you might get prompted to insert your Windows 2000 Server or Advanced Server CD (or locate the i386 folder on a local or network drive). To install DHCP Service: 1. 2. 3. 4. 5.

Open the Control Panel and double-click Add/Remove Programs. Click Add/Remove Windows Components. Highlight Networking Services and click Details. Select Dynamic Host Configuration Protocol (DHCP) and click OK. Click Finish when prompted.

Configuring your DHCP server After you install a DHCP server, go to Start | Programs | Administrative Tools | DHCP to open the Windows 2000 console for managing the DHCP service.

2. (a) Install the routing and remote access services as VPN server in Windows 2000 server. Also, create a VPN Remote Access policy. (10 Marks) Solution: To enable RRAS and configure it as a VPN server 1. Open the RRAS MMC Snap-in. 2. Right-click the server name for which you want to enable routing, and then click Configure and Enable Routing and Remote Access. If you are using Server Manager, right-click Routing and Remote Access, and then click Configure and Enable Routing and Remote Access. 3. On the Welcome page, click Next. 4. On the Configuration page, click Remote Access (dial-up or VPN), and then click Next. 5. On the Remote Access page, select VPN, and then click Next. 6. On the VPN Connection page, select the network interface that is connected to the public Internet from which remote VPN clients will connect to this server. 7. To configure packet filters that restrict network access through the specified public network adapter to only the ports required by VPN clients, select Enable security on the selected interface by setting up static packet filters. This option is different from firewall rules that you create by using Windows Firewall with Advanced Security. 8. On the Network Selection page, select the private network to which remote VPN clients are to be granted access. The network adapter and its IP address are displayed to help you determine which to select. 9. On the IP Address Assignment page, specify the way in which the RRAS server will acquire IP addresses for the remote VPN clients. If you have a DHCP server with a range of addresses available, click Automatic. If you want the RRAS server to manage the IP addresses itself, click From a specified range of addresses. 10. Note : If you selected

Automatic in step 9, then skip step 10.

11. On the Address Range Assignment page, click New, and then type starting and ending IP addresses to create the range from which remote VPN clients are assigned addresses. You can enter multiple ranges if required. Click Next when you have created the address ranges. 12. On the Managing Multiple Remote Access Servers page, select whether you want to use a centralized RADIUS server for authentication of your network clients. If you select No, then RRAS uses its local account RAS and IAS Servers security group by using Active Directory Users and Computers or by using the netsh ras add registeredserver command.

13. On the Completing page, click Finish. To configure an existing RRAS server to support VPN remote access 1. 2. 3. 4. 5.

Open Server Manager. Expand Roles, and then expand Network Policy and Access Services. Right-click Routing and Remote Access, and then click Properties. Select IPv4 Remote access Server or IPv6 Remote access server, or both. When you are prompted to restart RRAS, click Yes.

2. (b) Which command of Unix/Linux is used to perform the following task? Also, give an example for each. (10 Marks) Solution: (i) Command used for searching one or more files for a given character string or pattern. Grep command: Here is the basic syntax information of grep command. grep [OPTIONS] PATTERN [FILE...] Search in more that one file If more than one file is supplied in argument list then grep searches for the pattern or string in all the files. For example : #

grep "Linux" input.txt output.txt input.txt:Welcome to Linux.

output.txt : I hope you enjoyed working on Linux.

Match patterns using regular expressions The grep command also allows the usage of regular expressions in pattern matching. This provides tremendous power to user using the grep command to search for any possible pattern that can be represented through regular expression. Here is an example : # grep -r ".*Linux" output.txt output1.txt output.txt:I hope you enjoyed working on Linux. output1.txt:Welcome to Linux. output1.txt:I hope you will h ave fun with Linux. (ii) Command allows a System Administrator to give certain users the ability to run some commands as root or another user. Sudo command: You need to use the sudo command which is use to execute a command as another user. It allows a permitted user to execute a command as the superuser or another user, as specified in the /etc/sudoers (config file that defines or list of who can run what) file. The sudo command allows users to do tasks on a Linux system as another user. Examples a) Allow jadmin to run various commands: jadmin ALL=/sbin/halt, /bin/kill, /etc/init.d/httpd b) Allow user jadmin to run /sbin/halt without any password i.e. as root without authenticating himself: jadmin ALL= NOPASSWD: /sbin/halt c) Allow user charvi to run any command from /usr/bin directory on the system dev02: charvi dev02 = /usr/bin/* (iii) Command shows the status of ports is pen, closed, waiting, etc.

netstat {--route|-r} [address_family_options] [--extend|-e[--extend|-e]] [--verbose|-v] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--continuous|-c] (iv) Command shows the route of a packet. Running route at the command line without any options will display the routing table entries: Route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.1.2 0.0.0.0 UG 1024 0 0 eth0 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 (v) Command that captures packets off a network interface and interprets them for you Tcpdump Displays contents of /proc/net files. It works with the Linux Network Subsystem, it will tell you what the status of ports are ie. open, closed, waiting, masquerade connections. It will also display various other things. It has many different options.

BCSL-063.pdf

Page 1 of 4. BCSL-063 2016-17 session. 1. (a) What a shell script that list and delete the files having file size range 0-1 bytes, 1-10 bytes, 10-20. bytes and ...

655KB Sizes 4 Downloads 126 Views

Recommend Documents

No documents