PacNOG 6: Nadi, Fiji IP BASICS Notes: ------ * Commands preceded with "$" imply that you should execute the command as a general user - not as root. * Commands preceded with "#" imply that you should be working as root. * Commands with more specific command lines (e.g. "RTR-GW>" or "mysql>") imply that you are executing commands on remote equipment, or within another program. EXERCISES --------- 1. Configure a Network Interface ----------------------------- When you installed Ubuntu you configured your pimrary network interface with a static IP address. To see this address and all currently available network interfaces on your machine type: $ ifconfig To view information for your primary network interface (Linux only): $ ifconfig eth0 To actually make changes to these settings you need extra privileges. We are going to use ifconfig to configure your PC with a static IP address. To start we are going to pick a private address range from RFC 1918: 10.0.0.0 - 10.255.255.255 (10/8 prefix) 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) Let's use 192.168.1.0/24: $ sudo ifconfig eth0 192.168.1.10/24 Or, you could have typed: $ sudo ifconfig eth0 192.168.1.10 netmask 255.255.255.0 Do you have a gateway address for this address? $ route What was it? Try reconfiguring your eth0 interface with another private address space such as 10.0.0.0. What gateway did you end up with? What was the IP address and the netmask that you chose? 2. Ping Your Neighbor's PC ----------------------- This exercises requires that you talk to your neighbors and coordinate with them. GOAL: Connect your PC and your neighbor's PC using an agreed upon private address pair. If you complete this successfully you will be able to type: $ ping address_of_neighbor and you will see a response from your neighbor's machine. Example, you could choose an address range like: 10.0.100.0/24 Your separate IPs could be: 10.0.100.10 10.0.100.11 Do you need a gateway to ping each others machines? Try using some other private addresses. 3. Reset your network configuration -------------------------------- Now that you have configured your primary network interface to use a private address you need to reconfigure your network to use the address information you assigned when you first installed Ubuntu. This information is stored in the file: /etc/network/interfaces If you wish to read about this file you can type: $ man interfaces To tell Ubuntu to stop and then start networking using the information in this file do: $ sudo /etc/init.d/networking stop $ sudo /etc/init.d/network start Now see if your network has been reconfigured to look as it did at the start of this exercise: $ ifconfig $ route Is it?