Mandrake/Mandriva comes with a Network and Internet Configuration Wizard, which is preferably started up from Mandrake's Control Center. For static configuration you can enter the IP address, netmask, DNS server and default gateway manualy (DNS and default gw is your modem IP address e.g.10.1.1.1 and the netmask is usually 255.0.0.0), OR you can try this long manual way:
First type this in the console:
which will list all your network devices. If you use modem/router with enabled DHCP server (which usually is the case by default) then you can get an IP address by typing:
# dhclient eth0
loged as root. You will see some messages about quering the DHCP server and requesting an IP address. If this command is succesfull you will get an IP address for eth0 interface and this will also set the DNS for you in the /etc/resolv.conf file and the default gateway for internet access. You can check this with one of these commands as root:
# route -n
# netstat -r
If this works you are ready for surfing
If your only option is manual setting of the network then run this command but you have to know at least one DNS server IP (you can obtain this from your ISP or just use the modem one) and IP address for your interface (let say your network is 10.1.1.0, you can find this in your modem/router manual):
# ifconfig eth0 10.1.1.3 netmask 255.0.0.0 broadcast 10.1.1.255
Then you have to set the default gateway also manualy which is usually the IP address of the modem/router which in this case will be 10.1.1.1:
# route add default gw 10.1.1.1 dev eth0
and the DNS server(s) in /etc/resolve.conf:
# vi /etc/resolve.conf - put here the following line(s), you can use some other text editor if you are not comfortable with vi
(you can have only one nameserver line in this file usually the address of the modem 10.1.1.1 in this example) then type:
# ifconfig eth0 up
and you are ready to go (check with ifconfig command again).
In case of manual setup you should know that your eth0 interface will loose it's settings after restart so to make these changes permanent you have to edit the network file /etc/sysconfig/network-scripts/ifcfg-eth0 and put/change lines like this for eth0 section:
and save the file. On the next boot up the network should be already configured for you. Please change all these values from the example with your apropriate ones.
I hope this helps.