Setting up a single Mandrake/Mandriva Linux PC with
ethernet IP address.
Assumes you have a simple network, you have run Mandrake's
Internet wizard and still cannot connect to the Internet.
For the following environments:
This_PC-->hub/switch-->another PC running (working) internet
Not suitable for a computer that shares its connection (but may help
you understand some of the files/concepts) - see Internet
or Internet connection
sharing with a dial-up modem
for these scenarios.
First check your cabling
Windows connect if you have a dual boot machine? Do they work on a
known good network?
For our purposes:
Network interface cards (NIC
are called eth0, eth1 etc in Linux
is a number
uniquely identify a network interface
IP address of the device connected to the internet eg. your router, or
PC running internet connection sharing (ICS
The address to use is the one allocated to the interface connected to
your internal network. It will almost certainly be in one of the ranges
in "Note about IP addresses" below. Most likely 192.168.0.1 ,
192.168.1.1 or 10.0.0.1
address is the
address of your internet service providers (ISP) nameserver - used to
look up the corresponding IP address of a human readable address like
is a unique name
your computer - anything you like, for example linux.mylan.home or
zeus.greekgods or kevin but not www.google.com, www.microsoft.com...
Note about IP addresses:
Each interface on your network must have a different IP address. The
usual numbering schemes for private networks are 192.168.x.x or 10.x.x.x
The numbering scheme used should match that of your gateway device
(router, PC running internet connection sharing (ICS),cable modem etc)
if you have one. For example, if your router manual says the IP address
is 192.168.1.1 you will number your computer network interfaces
192.168.1.2, 192.168.1.3 etc.
You need to find out what your IP address and default gateway are -
these can be obtained from a working windows installation if you dual
boot, or your router/cable modem manual as above. You will also need
your nameserver IP address (get it from your ISP)
You will need to be root (administrator) to edit the files here.
To sign on as root - type su in a terminal (console), press enter
followed by your root password
- This is the main
config file for the interface.
It should read : (you can leave out anything on a line after #)
IPADDR=192.168.1.2 # or
whatever your IP address is to be - see above
NETMASK=255.255.255.0 # or 255.0.0.0 if
your IP address is 10.x.x.x
NETWORK=192.168.1.0 # or 10.0.0.0
if your IP address is 10.x.x.x or 192.168.2.0 if your IP address is
BROADCAST=192.168.1.255 # or 10.255.255.255 if your IP
address is 10.x.x.x or 192.168.2.255 if your IP address is 192.168.2.x
the nameserver address(es) - put the address of your ISPs nameserver
right at the top. eg:
If you are using a router that provides DNS lookup
forwarding (many do - check the manual) you can put the IP address
of that in here e.g. 192.168.1.1 . If unsure, use the ISP's DNS address.
The default gateway and your hostname go in /etc/sysconfig/network
GATEWAY=192.168.1.1 # or the IP address of your
gateway device - your default gateway
In a terminal, type:
iptables -t nat -D PREROUTING -i
You may get an error with this - don't worry - if you do, just skip the
Add the above code to the bottom of
This will bypass a proxy server Mdk will have set up if you ran the ICS
Then type ifup eth0
- this should
bring up the network
Then try it all out:
Try pinging your computers NIC (type "ping
" or whatever your IP address is) If you get errors,
then your NIC is not working - ask for help (see below).
If OK - Try pinging the gateway
If OK - Try browsing - if you cannot reach say, www.google.com, try
typing http://184.108.40.206 (IP address of google) into your browser
(If you cannot reach a site by name, but can get it by IP address, you
have a name resolver (DNS) problem.
Check to make sure it all works across a reboot.
Once working, you should set up a firewall - see http://www.shorewall.net/
on the 'standalone Linux system' link there.
If you are still having problems
post the following information in the networking forum:
Overview of your problem - not just "I can't connect to the internet" -
what have you done/tried so far, what works, what doesn't?
Physical network set up - what plugs in to what
Output of "ifconfig" , "route -n" , "iptables -nvL" and "iptables -nvL
Results of all pings above.
Please pass on your comments
me - consider this work in progress.
If you live on the Isle of Wight (UK)
and you are still stuck, give me a call!
For other mandrake Linux problems, try Mandrivausers.org
IOW PC - Isle of Wight ( UK ) computer help for you & your business
0789 150 9466 / IW 731467 / IW 897033