Previous Next Table of Contents

7. Networking.

7.1 Q: How do I configure my ethernet card?

A: First you need a supported network card builded in your kernel. When this is done all you need is to specify an IP and to edit the routing table. Your first ethernet will be available via eth0 name. So for specifing the IP noumber to the etnernet you need to run a program called "ifconfig". If you need more information about it just type "man ifconfig" and you will get all the switches which are supported by the program.

7.2 ifconfig

So now how to use ifconfig. Lets say we are going to use this IP noumber 192.168.1.2 and we are connected to 192.168.1.1 which is our computer connected to InterNet. Our command for specyfing our IP to our ethernet is "/sbin/ifconfig eth0 192.168.1.2". This command will add to our ethernet the 192.168.1.2 IP noumber. All we have to do now is to edit the route table.

7.3 route

This is done via a program called "route". All we gave to do is to type "route add default gw 192.168.1.1" This will add an entry to our route table which will point to our computer connected into internet.

7.4 Comments

For those who dont what are they doing I suggest to read some books about networking. There are a lot of book online and they can be get for free. As you work with your hardware and the priority needed is really high you need to be root user to do those changes. I won't even try this as an user cause it won't worn. If you network still doesn't work you can check your IP address and your route table with the 2 already mentioned programs. If they are run without any parameters they will display you all the info they have. So if you run just "ifconfig" it will display all the network devices you may have and their IP, broadcast, network addresses.. It is nice for checking what is wrong. For the route table you can check with "route".

7.5 Examples


   Here are some examples from running ifcofig and route



   # ifconfig example

   # ifconfig

   lo        Link encap:Local Loopback

             inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0

             UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1

             RX packets:317 errors:0 dropped:0 overruns:0

             TX packets:317 errors:0 dropped:0 overruns:0



   eth0      Link encap:10Mbps Ethernet  HWaddr 00:A0:24:58:66:1E

             inet addr:192.168.1.2  Bcast:192.168.1.255 Mask:255.255.255.0

             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

             RX packets:9 errors:0 dropped:0 overruns:0

             TX packets:2 errors:0 dropped:0 overruns:0

             Interrupt:10 Base address:0x6000

   #                            



   # route example

   # route

   Kernel IP routing table

   Destination     Gateway         Genmask         Flags Metric Ref Use Iface

   192.168.1.0     *               255.255.255.0   U     0      0     1 eth0

   127.0.0.0       *               255.0.0.0       U     0      0     2 lo

   default         192.168.1.1     255.0.0.0       GW    0      0     2 eth0

   #



Previous Next Table of Contents