Anda di halaman 1dari 2

Computer and Network Security Laboratory Driving Linux

Session 0f

IMPORTANT NOTE: the next two labs are heavily dependent on this one. You MUST do all the things in this lab and make sure you understand them. Do not work with anyone else. Do it yourself. Unlike most of the labs, the stuff you do in this session is more important than the write up. In fact for this week only, there is NO write up. Introduction to this laboratory session Linux is available in a number of distributions, each of which contains a core operating system, a selection of packages and some configuration tools, usually GUI. The main difference between the distributions is in exactly which version of applications they contain and in their GUI configuration tools. At Glyndwr, we have Fedora 13. This is freely available either to down load or copy from someone else. You did some work with Linux last year. This lab is a reminder of the basics and specifically shows how to configure Fedora 13 networking, in preparation for the next two labs. It is recommended that you bring this sheet to the next two lab sessions. Resources for this laboratory session Two PCs. One running a version of Linux. We use Fedora 13 but most recent versions are very similar. The other can run anything but needs to have a TCP/IP stack running and be able to reply to ICMP echo requests (ping) for testing. Student activity Boot into Linux and log in. You will need to be authenticated as root to do most of this lab and the rest of the Linux based ones. In a terminal window, use su. When using GUI tools, it will ask for the root password when required. You can tell that you are logged in as root because the prompt in a terminal window tells you and ends in #. You have to be logged in as root to change network settings. A lot of the stuff well do is at the command line, although some can be done using GUI tools. Open a terminal window. At the prompt type: ifconfig which does the same as Windows ipconfig. Make a note of the IP addresses, subnet masks and Ethernet addresses of any interfaces listed. Try to ping another machine. Linux ping carries on until you stop it (CTRL/C) rather than just doing four pings. This can be helpful as you can set it going, change other things and see the effect straight away. Start the GUI network configuration tool, from the System menu, Administration, Network. It will ask for the root password. Select the Device tab and double click on the interface you want to change. You can select Automatic Address Setup (via DHCP). You may need to check the Activate device when computer starts box and the Allow all users to enable and disable the device box. Leave everything else alone for now. Click Next. Do the same for each interface on your list. There may be anything between one and four depending on the PC you are using. Once they are all set, click OK. This will save all the configurations, restart all network aspects of the operating system (NICs, Firewall, routing and other services) and close the dialogue.

Computer and Network Security Laboratory

Session 0f

Go back to the terminal and try ifconfig again. You should have at least two entries. The one for the on board NIC will be labelled eth0 (or some other number, if you have lots of NICs). The other is lo which is the local loopback, with IP address 127.0.0.1. Make a note of the configurations, in particular the label (eth0 etc), IP address mask and HWaddr (=ethernet address). At this point you should be able to ping your machine. Note that not all machines in B121 have access to DHCP, so the above section may not give you an IP address. We are now going to configure the IP address manually. Well need to do this next week as we need to control the IP addresses. DHCP will not be available in our test network. From the Network Configuration dialogue, open the network card configuration and double click on the required interface. Click on Statically Set IP Address. Key in the required IP address and Subnet Mask. Click OK to save. You can restart the network interface using ifdown eth0 and ifup eth0. Substitute the required interface name. For later labs, you need to start IP forwarding on the machine with 2 network cards in. To do this from the command prompt, type sysctl -w net.ipv4.ip_forward=1 (i.e. system control write to network ipv4 ip forwarding the value 1). To make the change permanent change the file /etc/sysctl.conf entry to say net.ipv4.ip_forward = 1 Check your configuration with ifconfig and ping. There is a GUI Firewall control package. (System, Administration, Firewall). This is a very pretty GUI but it doesn't give as much control over the settings as we need for out later lab. Have a look at it now. It gives a warning on startup that tells us it will only do a basic job (paraphrasing). There is a Wizard to help set it up. Enable/Disable are obvious. Tursted Services configures what can get through the firewall. It is installed as a default deny setup and from here you tell it what to allow. You can override these settings manually: see next weeks lab. There are also settings for other things, which you should investigate. Getting data out It is a bit fiddly getting data out of B121 when you have been using Linux. You can capture output from command line utilities using re-direction just like in Windows. E.g.: ifconfig > ifconfig.txt Laboratory Report 1. No write up, but make sure you can do everything on this sheet. I would suggest working through it in detail in the session, then coming back another day to run through it again, on a different machine so that you have to at least check everything. 2. Better still, install Fedora 13 on your PC at home and have a real go at using it. (Caveats over risk to your data, PC, long term health and wealth apply).

Anda mungkin juga menyukai