Keep in mind that your home LAN is a totally separate issue from your Wide Area Network (WAN) Internet connection. Your WAN almost always uses DHCP. A computer on your LAN can use DHCP (or not) but must have a valid IP address assigned.
Here is what a computer needs to access the Internet.
- Computer has IP Address on LAN (usually 192.168.xxx.xxx)
- Network mask (usually 255.255.255.0)
- Address of a gateway/router to reach the Internet
- Address of a name server (DNS server) to look up computer names
Your Belkin router is the gateway/router. Its address is probably 192.168.2.1. So the gateway/router address should probably be 192.168.2.1.
The network address of your LAN is probably "192.168.2.0" and your computer's IP address should probably be "192.168.2.xxx". The "xxx" is either assigned by the router using DHCP or specified manually in a configuration file. Most routers use 1 or 254 for their address That leaves 2 through 253 as long as no other computers are using the same address. DHCP prevents assignment of duplicate addresses (for all the computers using DHCP). When you manually assign an address you have to avoid using any address that might be manually configured on some other computer, or assigned automatically by DHCP. You can look at your router's settings to find out the range of addresses that it might assign using DHCP.
The name server address is often the same as the gateway/router because the router can forward the requests to the name server for your Internet provider.
The "lspci" output shows that you have two Ethernet adapters.
- SiS900 PCI Fast Ethernet
- RTL-8139/8139C/8139C+
The "ifconfig" output shows that you have one configured Ethernet adapter.
Quote:
Originally Posted by adoltswimmer
Code:
eth0 Link encap:Ethernet HWaddr 00:13:D4:09:9C:AC
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:19 Base address:0x9800
|
Compare that to Crunchbag.
Quote:
Originally Posted by adoltswimmer
Code:
eth1 Link encap:Ethernet HWaddr d8:5d:4c:f2:a8:a6
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::da5d:4cff:fef2:a8a6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1050 errors:0 dropped:0 overruns:0 frame:0
TX packets:788 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:376237 (367.4 KiB) TX bytes:144255 (140.8 KiB)
Interrupt:18
eth2 Link encap:Ethernet HWaddr 00:13:d4:09:9c:ac
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:19 Base address:0x9800
|
Notice that the "HWaddr" for "eth0" is the same as "eth2" in Crunchbag. The "HWaddr" (MAC address) uniquely identifies a network interface. I think that your LAN cable is probably plugged into the other Ethernet card, labeled as "eth1" in Crunchbag. That interface wasn't configured in Slackware.
Since "eth0" does have an IP address configured, the address is probably set in "/etc/rc.d/rc.inet1.conf". Look at that file to determine which network interfaces are using DHCP or have an IP address specified.
I also recommend that you use "ifconfig -a" to show all network interfaces, including the ones not configured and connected. If you see the second Ethernet interface then it has a driver installed but needs to be configured. If you don't see the second Ethernet interface then you need to install or load the driver for the interface.
The interface where the LAN cable is connected will probably have the name "eth1". That is determined by some "udev" rules. The configuration file is called "/etc/udev/rules.d/70-persistent-net.rules". The device names are usually assigned based on the hardware (MAC) address.
Code:
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:01:66:d8", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Notice that the "NAME" specifies the name of the device and "ATTR{address}" is used to match a particular hardware MAC address. If you add an entry for each network interface with the correct MAC address then you can specify the name that you want. You probably want to make the interface with hardware address "d8:5d:4c:f2:a8:a6" be the "eth0" device since it is where you have connected the LAN cable.
So, once you have the interface names the way you want them you can specify the network settings in "/etc/rc.d/rc.inet1.conf".
You've basically got two choices for each network interface. You can use DHCP or you can specify the required information.
Code:
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""
# Config information for eth1:
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""
# Default gateway IP address:
GATEWAY=""
Code:
# Config information for eth0:
IPADDR[0]="192.168.2.2"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]="no"
DHCP_HOSTNAME[0]=""
# Config information for eth1:
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""
# Default gateway IP address:
GATEWAY="192.168.2.1"
If you don't use DHCP then you have to specify the address of the gateway used to reach the Internet. That will be the address of your Belkin router.
You can see what gateway address is configured by using the "route" command with no other options.
Code:
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 202 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 192.168.2.1 0.0.0.0 UG 202 0 0 eth0
The "default" route should show your Belkin router's address in the "Gateway" column. Any packets not being sent to your LAN (192.168.2.0) or loopback (127.0.0.0) will use the default route and go to the Belkin router. If you use DHCP, the default gateway will be configured automatically and you can omit the information in the "rc.inet1.conf" file.
There is one last piece of information needed when manually configuring your network. You must specify a name server (DNS server). That is used when you enter web site names such as "www.google.com". The name server is used to find the IP address associated with each name.
The name server can be specified in the file "/etc/resolv.conf".
Code:
nameserver 192.168.2.1
Most routers have a feature called DNS relay or DNS forwarding. You can specify the address of the router as your name server, and the router will forward the requests to the correct name server. That way, you can let your Belkin router deal with any changes in the DNS server address.
If the router doesn't do DNS forwarding then you should specify your Internet provider's DNS server address. Providers do not frequently change their DNS server addresses.
When you use DHCP, the information in "/etc/resolv.conf" is updated automatically. You don't have to edit the file when using DHCP.
To determine if your name server is working, use the "nslookup" command.
Code:
nslookup www.google.com
Server: 192.168.2.1
Address: 192.168.2.1#53
Non-authoritative answer:
www.google.com canonical name = www.l.google.com.
Name: www.l.google.com
Address: 74.125.45.99
Name: www.l.google.com
Address: 74.125.45.106
Name: www.l.google.com
Address: 74.125.45.147
Name: www.l.google.com
Address: 74.125.45.105
Name: www.l.google.com
Address: 74.125.45.104
Name: www.l.google.com
Address: 74.125.45.103
What order works best for testing network connectivity? Usually I start by trying to ping the router.
ping 192.168.2.1
If that doesn't work, then it is time to look at the "ifconfig -a", "route" and the configuration files. Get "70-persistent-net.rules" sorted out first, so that the device names are predictable and correct. Make sure that you know the MAC address of the network interface you are using. Next, make sure that "rc.inet1.conf" is correct. I usually reboot the computer after changing either of those two files. You should be able to ping the router when they are correct.
After you can ping the router, then make sure the default gateway and DNS server information is correct. When you can't access the Internet, but can access other computers and the router, then you may have a problem with the gateway or DNS server. Your WAN connection on your router could have failed, so make sure that some other computer can access the Internet!