[ Contents ] [ Prev ] [ Next ]

Lucky With LAN


Ethernet Cards - Not Your Friendly "Egged" Drivers


Networks And Net-masks


IP Configuration Of The Ethernet Controller

In order to actually configure the Ethernet controller's IP address (assuming a static IP here), one may use the 'ifconfig' command (as user root, of-course). Here is how:

[root@simey ~]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:01:02:9D:EB:92
          inet addr:192.217.24.5  Bcast:192.217.24.255  Mask:255.255.255.0
          UP BROADCAST RUNNING  MTU:1500  Metric:1
          RX packets:2256 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2868 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          Interrupt:12 Base address:0xec00
We see here the internet address of the card, the broadcast address for its LAN, the netmask, and a few other parameters. To actually set these parameters, the command used could have been:

ifconfig eth0 192.217.24.5 netmask 255.255.255.0 broadcast 192.217.24.255

Note: running the 'ifconfig' command in read-only mode may be done by any user, not just root, using the command's full path - '/sbin/ifconfig'.


The Route To Freedom


Viewing The Routing Table

In order to view our system's routing table (the table defining how to communicate with various systems), we may use the 'netstat -r' command:

[choo@simey ~]$ netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.217.24.5    *               255.255.255.255 UH        0 0          0 eth0
192.217.24.0    *               255.255.255.0   U         0 0          0 eth0
127.0.0.0       *               255.0.0.0       U         0 0          0 lo
default         192.217.24.254  0.0.0.0         UG        0 0          0 eth0
As we can see, data sent to the address '192.217.24.5' should go through the Ethernet controller. Data sent to our LAN (network 192.217.24.0) also goes through the Ethernet controller. Data sent to network '127.0.0.0' - a special machine internal network, goes via a special loopback device, which is a virtual device. Finally, data sent to any other IP address is sent to the gateway machine '192.217.24.254', via our Ethernet controller.


Automatic Configuration using DHCP

[ Contents ] [ Prev ] [ Next ]