Restart network 

Debian 

/etc/init.d/networking restart

RedHat 

% service network stop
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]

Network card setup 

Get all info from dos:

ipconfig /all > inet.txt

Manual config NIC 

If 'ifup -a' does not work, bring up the NIC by hand:

  1. load the NIC driver

    # modprobe 8139too
  2. configure the NIC

    # ifconfig eth0 inet 192.168.0.99 up
    or via dhcp:
    # dhclient eth0
  3. set the default gateway if any

    # route add default gw 192.168.0.1

Connection check 

ifconfig
ip address show
route
ip route show
ip link show
cat /var/lib/dhcp/dhclient.leases

Remove default gateway (temporally) 

route del default gw 192.168.0.1

Sample 

% route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.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.168.0.1     0.0.0.0         UG    0      0        0 eth0
% route del default gw 192.168.0.1
% route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo

Remove static gateway 

> Another question, how can I removed the static gateway setting?
> I set my static gateway via linuxconf. I don't have linuxconf now,
> and I don't know where linuxconf stores the static gateway setting.
> I'm just using 'route del' to remove default routing temporally.

If Redhat or Mandrake you could look in

/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0

Bit Twister

Static setting 
/etc/sysconfig/network:
NETWORKING=yes
HOSTNAME=xpt
GATEWAY=192.168.0.1
/etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.100
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes

Change 

before change 
$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.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.168.0.1     0.0.0.0         UG    0      0        0 eth0
change to 
--- /tmp//1382.tmpf.workon.5317      2003-10-23 13:58:40.000000000 -0400
+++ /etc/sysconfig/network      2003-10-23 13:58:40.000000000 -0400
@@ -1,3 +1,2 @@
 NETWORKING=yes
 HOSTNAME=xpt
-GATEWAY=192.168.0.1
/etc/sysconfig/network-scripts/ifcfg-eth0: same
Tip !!
ifdown eth0
$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
ifup eth0
$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo

cmd:ipcalc 

ipcalc - perform simple manipulation of IP addresses
$ /bin/ipcalc --netmask 192.168.0.1
NETMASK=255.255.255.0
$ /bin/ipcalc --broadcast 192.168.0.1 255.255.255.0
BROADCAST=192.168.0.255

ipcalc and other IP addressing calculators 

http://linux-ip.net/html/tools-ipcalc.html

There are a number of different utilities called ipcalc, almost all of which perform the same basic task. These are handy calculators for converting from CIDR to traditional IP notation and determining network and broadcast addresses.

Doubtless, there are a large number of other IP calculators available to ease the job of the network administrator. The above tools are meant as a brief summary of some of the offerings.

ipcalc from Debian 

NAME
      ipcalc - An IP Netmask/broadcast/etc calculator
SYNTAX
       ipcalc  [-n|-h|-v|-help] <ADDRESS>[[/]<NETMASK>] [NETMASK]
DESCRIPTION
      ipcalc  takes  an  IP  address and netmask and calculates the resulting
      broadcast, network, Cisco wildcard mask, and host range.  By  giving  a
      second  netmask,  you  can  design  sub-  and supernetworks. It is also
      intended to be a teaching tool and presents  the  results  as  easy-to-
      understand binary values.
-n     Don't display ANSI color codes
-b     Suppress the bitwise output
-c     Just print bit-count-mask of given address
EXAMPLES
      ipcalc 192.168.0.1/24
ipcalc 192.168.0.1/255.255.128.0
ipcalc 192.168.0.1 255.255.128.0 255.255.192.0
ipcalc 192.168.0.1 0.0.63.255
AUTHOR
           Written by Krischan Jodies <krischan@jodies.de>
SEE ALSO
      ipsc(1) gipsc(1)
The ipcalc website: http://jodies.de/ipcalc
$ ipcalc -n -b 192.168.0.1/24
Address:   192.168.0.1
Netmask:   255.255.255.0 = 24
Wildcard:  0.0.0.255
=>
Network:   192.168.0.0/24
HostMin:   192.168.0.1
HostMax:   192.168.0.254
Broadcast: 192.168.0.255
Hosts/Net: 254                   Class C, Private Internet

ipsc from Debian 

usage: ipsc [options] <addr/mask | addr/offset | addr>
        -C <class>      Network class (a, b, or c).  Must be used with -B
        -B <bits>       Subnet bits (must be used with -C)
        -i <if>         Reverse engineer an interface (e.g. eth0)
        -a              Print all information available
        -g              Print general information
        -s              Print all possible subnets
        -h              Print host information
        -c              Print CIDR information
$ ipsc -i eth0
Network class:            C
Network mask:             255.255.255.0
Network mask (hex):       FFFFFF00
Network address:          192.168.15.0
Subnet bits:              0
Max subnets:              1
Full subnet mask:         255.255.255.0
Full subnet mask (hex):   FFFFFF00
Host bits:                8
Addresses per subnet:     256
Bit map:                  nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh

ipcalc from RedHat 

http://linuxcommand.org/man_pages/ipcalc1.html

SYNOPSIS
ipcalc [OPTION]... <IP address>[/prefix] [netmask]
DESCRIPTION
ipcalc  provides  a  simple way to calculate IP information for a host.
The various options specify what information ipcalc should  display  on
standard  out.  Multiple  options  may  be specified.  An IP address to
operate on must always be specified.  Most operations  also  require  a
netmask or a CIDR prefix as well.
OPTIONS
-b, --broadcast
       Display  the  broadcast  address for the given IP address
       and netmask.
-h, --hostname
       Display the hostname for the given IP address.
-m, --netmask
       Calculate the  netmask  for  the  given  IP  address.  It
       assumes  that the IP address is in a complete class A, B,
       or C network. Many networks do not use the  default  net-
       masks,  in  which  case  an  inappropriate  value will be
       returned.
-p, --prefix
       Show the prefix for the given mask/IP address.
-n, --network
       Display the network address for the given IP address  and
       netmask.
-s, --silent
       Don't ever display error messages.
AUTHORS
Erik Troan <ewt@redhat.com>

documented on: 2005.02.16

# Getting ip address/devices (you have to be root and the netlink tools
# installed)
# allowed shortcuts:
#
# address      a
# route        r
# show         s
# add          a
# delete       d
# set          s
# get          g
#
# syntax:
#
# ip address|route|link show|add|delete|set|get [ip-addressss/mask] [dev [device]] [up|down]
#
# getting the ip addresses
> ip address show      # is the same as: "ip a s" or: "ip a"
1: lo:  mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
2: eth0:  mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:03:47:c4:0d:75 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.1/24 brd 192.168.0.255 scope global eth0
13: ppp0:  mtu 1500 qdisc pfifo_fast qlen 3
    link/ppp
    inet 80.121.6.248 peer 172.19.92.167/32 scope global ppp0
# getting the routing table
> ip route show        # the same as: "ip r s" or: "ip r"
172.19.92.167 dev ppp0  proto kernel  scope link  src 80.121.6.248
192.168.0.0/24 dev eth0  scope link
127.0.0.0/8 dev lo  scope link
default via 172.19.92.167 dev ppp0
# getting the devices
> ip link show         # the same as: "ip l s" or: "ip l"
1: lo:  mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0:  mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:03:47:c4:0d:75 brd ff:ff:ff:ff:ff:ff
13: ppp0:  mtu 1500 qdisc pfifo_fast qlen 3
    link/ppp
# deleting an ip address
# before deleting:
> ip a s dev eth0              # = ip address show dev eth0
2: eth0:  mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:03:47:c4:0d:75 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.1/24 scope global eth0
# deleting the ip: "ip address delete 192.168.0.1/24 dev eth0"
> ip a d 192.168.0.1/24 dev eth0
# after deleting:
> ip a s dev eth0
2: eth0:  mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:03:47:c4:0d:75 brd ff:ff:ff:ff:ff:ff
# shutting down a device ( ip link set dev eth0 down ):
>ip l s dev eth0 down
# adding an ip address ( =  ip address add 192.168.0.1/24 dev eth0 ):
> ip a a 192.168.0.1/24 dev eth0
# the result:
> ip a s dev eth0
2: eth0:  mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:03:47:c4:0d:75 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.1/24 scope global eth0
# starting up a device ( not always necessary )
> ip l s dev eth0 up
# getting the route to a specific address ( = ip route get 198.168.0.10 )
> ip r get 198.168.0.10
198.168.0.10 via 172.19.92.167 dev ppp0  src 80.121.6.248
    cache  mtu 1500 advmss 1460
# deleting a route ( = ip route delete 192.168.0.0/24  dev eth0 ):
> ip r d 192.168.0.0/24 dev eth0
# the result
>ip r
172.19.92.167 dev ppp0  proto kernel  scope link  src 80.121.6.248
127.0.0.0/8 dev lo  scope link
default via 172.19.92.167 dev ppp0
# setting a route ( ip route add 192.168.0.0/24 dev eth0 ):
> ip r a 192.168.0.0/24 dev eth0
# the result
root@Jambalaya root # ip r
172.19.92.167 dev ppp0  proto kernel  scope link  src 80.121.6.248
192.168.0.0/24 dev eth0  scope link
127.0.0.0/8 dev lo  scope link
default via 172.19.92.167 dev ppp0
# settin the default route
# before setting the default route
> ip r
172.19.92.167 dev ppp0  proto kernel  scope link  src 80.121.6.248
192.168.0.0/24 dev eth0  scope link
127.0.0.0/8 dev lo  scope link
# setting the default route ( = ip route add default dev ppp0):
> ip r a default dev ppp0
# after setting the default route
> ip r
172.19.92.167 dev ppp0  proto kernel  scope link  src 80.121.6.248
192.168.0.0/24 dev eth0  scope link
127.0.0.0/8 dev lo  scope link
default dev ppp0  scope link

cmd:route & its routing table 

On Solaris,

# route add default 131.162.160.1
add net default: gateway 131.162.160.1
$ netstat -r
Routing Table:
  Destination           Gateway           Flags  Ref   Use   Interface
131.162.160.0        chaos                 U        3  13670  hme0
BASE-ADDRESS.MCAST.NET chaos                 U        3      0  hme0
default              vlan-160.acadiau.ca   UG       0  33899
localhost            localhost             UH       0   4036  lo0
# netstat -nr
Routing Table:
  Destination           Gateway           Flags  Ref   Use   Interface
131.162.160.0        131.162.164.5         U        3    477  hme0
224.0.0.0            131.162.164.5         U        3      0  hme0
default              131.162.160.1         UG       0      2
127.0.0.1            127.0.0.1             UH       0   4397  lo0

documented on: 2000.10.20 Fri 20:59:58

Route Command? What is wrong here? 

>I have 3 nics all on diff networks on a linux box.  Its redhat 6.2 no
>updates (yet as I wanted to test, then patch OS/Kernel).  Here is the
>route command I am trying to implement:
>
>route add -net 175.23.0.0 netmask 255.255.0.0 eth1
>route add -net 24.231.45.0 netmask 255.255.255.0 eth2

Assuming you have something like this listed in your /etc/hosts file:

127.0.0.1   localhost
175.23.0.1  ifcooh    ifcooh.yourdomain.com
24.231.45.1 ifcone    ifcone.yourdomain.com
24.231.45.2 gwmain    gwmain.yourdomain.com

Where ifcooh and ifctwo are the two NICs, and gwmain is a gateway host accessable on the ethernet connected to ifcone.

And this in your /etc/networks file:

127.0.0.0   loopback
175.23.0.0  netooh
24.231.45.0 netone

You can use the ifconfig command like this

/sbin/ifconfig lo   localhost broadcast 127.0.0.255
/sbin/ifconfig eth0 ifcooh    broadcast 175.23.0.255
/sbin/ifconfig eth1 ifcone    broadcast 24.231.45.255

Then you can use the route command, like this

/sbin/route add -net loopback netmask 255.0.0.0     dev lo
/sbin/route add -net netooh   netmask 255.255.255.0 dev eth0
/sbin/route add -net netone   netmask 255.255.255.0 dev eth1

You can also add routing for individual hosts:

/sbin/route add gwmain dev eth1

And you can use that as a default gateway,

/sbin/route add default  gw gwmain  dev eth1

Or, you can just default everything to that interface, and hope that something on that ethernet will route it:

/sbin/route add default dev eth1

Floyd L. Davidson

Disabling IPv6 under a 2.6 kernel 

http://www.debian-administration.org/articles/409

To disable IPv6 it should be as simple as adding the lines

alias net-pf-10 off
alias ipv6 off

to /etc/modprobe.d/00local (creating the file if it exists).

It is important that this comes in a file earlier in an alphanumeric sort than aliases, since that contains aliases that turn this on.

Once you've made this change/addition you will need to restart the box afterwards - since the modules won't unload.

Disabling IPv6 under a 2.6 kernel 

echo "install ipv6 /bin/true" > /etc/modprobe.conf

Disabling IPv6 under a 2.6 kernel 

cat > /etc/modprobe.d/00_no_ipv6
blacklist ipv6
alias net-pf-10 off
alias ipv6 off
install ipv6 /bin/true
install sit0 /bin/true

T

documented on: 2006.08.14

module net-pf-10 

http://lists.suse.com/archive/suse-linux-e/2000-Dec/0169.html

Date: Sun Dec 03 2000
> Does anyone what module net-pf-10 is. It keeps appearing in my
> messages log file.

From some archive:

These errors are caused by the kernel (?) trying to load some modules it had in it's default installation. You have not specified these items to be compiled, so they cannot be loaded. The "net-pf-10" referes to ipv-6., which you can learn about by doing a google search.

The easiest way to get rid of these (non-fatal) error messages is to put the following in your /etc/conf.modules

alias net-pf-10 off # don't auto-load ipv6

Jerry Kreps

module net-pf-10 

> alias net-pf-10 off # don't auto-load ipv6

Excellent, many thanks :)

Slow DNS lookup? Disable IPv6! 

http://beranger.org/index.php?article=1127

Since I experienced slow DNS lookup with Debian testing/unstable, I felt I need to disable IPv6 — this has largely been blamed for that, and it's not really needed by most of the people.

Here's the summary of what I can think of, with alternate methods in case the first one doesn't work with you:

Note:

How to disable IPv6 

Symptom 

Users of Fedora Core 2 may experience unusually long delays in resolving hostnames. This results from the fact that IPv6 is enabled by default in Fedora Core 2.

Solution 

If you do not need IPv6 support (which is most likely the case), then it is advised that you disable it in the kernel. To do this run the following command as root:

echo "alias net-pf-10 off" >> /etc/modprobe.conf

You will need to reboot to have this take effect (or simply unload the ipv6 kernel module).

Turn off ipv6 

Turn off ipv6 so firefox loads pages faster

By default Firefox (and other Mozilla-compatible browsers) first tries to use IPv6 before it tries IPv4. This can create unnecessary delays in loading pages if your Internet connection doesn't support IPv6. To make Firefox use only IPv4 you can type "about:config" (without quotes) to the address space in Firefox, hit Enter and scroll down the page until you see this line:

network.dns.disableIPv6

Right-click the line and toggle its value from "false" to "true".

If you want to turn off IPv6 system-wide, this can be done in /etc/modutils/aliases — just find the following line and remove the # character from the beginning of the line:

# alias net-pf-10 off # IPv6

I did both and I find that Firefox now loads pages considerably faster. :)

documented on: 2005.08.27

3M ethernet configuration 

Newsgroups: comp.os.linux.setup
Date: Tue, 26 Nov 2002 23:43:17 -0500
> I was happy, when I succesfully installed the new Elitegroup k7s5a
> mainboard on my computer and got no error messages about the NIC.
> The other NIC (on board) was also successfully installed and my laptop can
> communicate with its linux box.
> But when I try to get connection to my ISP
> (telnet login.isp.address), I got error message (host unreachable).
>
> I don't know where to start finding the wrong configuration.
> Here are some outputs:
> ------------------------------------------------------
> # dmesg |grep "eth0"
> divert: allocating divert_blk for eth0
> eth0: Realtek RTL8201 PHY transceiver found at address 1.
> eth0: Using transceiver found at address 1 as default
> eth0: SiS 900 PCI Fast Ethernet at 0xd400, IRQ 10, 00:07:95:32:2e:41.
> eth0: Media Link On 100mbps full-duplex
> # dmesg |grep "eth1"
> divert: allocating divert_blk for eth1
> eth1: Digital DS21143 Tulip rev 65 at 0xd0908c00, 00:60:F5:A0:14:A1, IRQ 10.

I'm suspicious of this NIC. I've never seen a "divert" message before.

> # route -n
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
> 192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
> 134.174.63.0    0.0.0.0         255.255.255.0   U     0      0        0 eth1
> 127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
> 0.0.0.0         134.174.63.1    0.0.0.0         UG    0      0        0 eth1

Your default route goes through eth1 to your gateway at 134.174.63.1 Can you ping 134.174.63.1?

> # ifconfig
> eth0      Link encap:Ethernet  HWaddr 00:07:95:32:2E:41            inet
> addr:192.168.0.1  Bcast:192.168.0.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:4 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:100           RX bytes:0 (0.0 b)  TX
> bytes:168 (168.0 b)
>           Interrupt:10 Base address:0xd400

eth0 looks OK, sort of. You've sent 4 packets, and it's not encountered any errors. However, you've not received _any_ packets, which is somewhat suspicious.

> eth1      Link encap:Ethernet  HWaddr 00:60:F5:A0:14:A1
>           inet addr:134.174.63.134  Bcast:134.174.63.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:114 dropped:0 overruns:0 carrier:114
>           collisions:0 txqueuelen:100           RX bytes:0 (0.0 b)  TX
> bytes:0 (0.0 b)
>           Interrupt:10 Base address:0x8c00

eth1 looks to have problems. you've not been able to send or receive _any_ packets. all 114 packets that you've tried to send had carrier errors. It looks like your eth1 isn't properly configured for your lan speed, or some other problem is causing it to lose it's 'carrier'.

> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:69 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:6852 (6.6 Kb)  TX bytes:6852 (6.6 Kb)

As expected, lo is OK.

> # depmod -a (no output)
> # lsmod
> Module                  Size  Used by    Not tainted
> videodev                8288   2  (autoclean) [bttv]
> i2c-algo-bit            8840   1  (autoclean) [bttv]
> i2c-core               19268   0  (autoclean) [tuner bttv i2c-algo-bit]
> sr_mod                 18168   0  (autoclean)
> i810_audio             25224   1  (autoclean)
> ac97_codec             13416   0  (autoclean) [i810_audio]
> soundcore               6532   2  (autoclean) [i810_audio]
> autofs                 13348   0  (autoclean) (unused)
> tulip                  43552   1

OK, so a driver for eth1 is loaded. It might be the wrong driver, though. Have you tried the de4x5 driver? From the driver source, it looks like de4x5.o might be better suited to your eth1 NIC than tulip.o

> sis900                 16908   1

The driver for eth0 is loaded. The sis900 driver seems to be the correct one for the RTL8201 NIC.

> iptable_filter          2412   0  (autoclean) (unused)
> ip_tables              14936   1  [iptable_filter]
> ide-scsi               10512   0 scsi_mod              107240   2  [sr_mod
> ide-scsi]
> ide-cd                 33608   1 cdrom                  33696   0  [sr_mod
> ide-cd]
> ohci1394               20108   0  (unused)
> ieee1394               46892   0  [ohci1394]
> nls_iso8859-1           3516   4  (autoclean)
> nls_cp437               5148   3  (autoclean)
> mousedev                5524   1 keybdev                 2976   0  (unused)
> hid                    22244   0  (unused)
> input                   5920   0  [mousedev keybdev hid]
> usb-ohci               21320   0  (unused)
> usbcore                77024   1  [hid usb-ohci]
> # cat /etc/resolv.conf
> search hm.bochum.de
> nameserver 134.174.63.2
> nameserver 134.174.32.40
> nameserver 134.174.222.4
> # cat /var/log/messages |grep error (no output)
> ------------------------------------------------------
> Again: I have to connect through 'telnet login.isp.address' to get
> internet working.

How do you mean "get internet working"? How does telnetting to your isp "get internet working"?

Try a few things:

Lew Pitcher

3M ethernet configuration 

> >> There is no default route here. Packets destined for network addresses
> >> other than the two specified will have no place to go.
>
> Correction: the default route has been defined, and it sends packets out
> via eth1
> >>> 0.0.0.0         134.174.63.1    0.0.0.0         UG    0   0   0 eth1
>     -------         ------------                    --              ----
>      \-default route  \- uses gateway IP             \-Up/Gateway    \-eth1

Yep, absolutely right. I didn't know that IP addr 0.0.0.0 indicated the default route; every version of "route" I've ever used explicitly indicated a "default" entry. Sorry for the misinformation.

Steve Martin

linux can not find my network card 

Newsgroups: comp.os.linux.setup
> I can't sem to get networking to work. I have an SMC EZNET 10/100 PCI
> Ethernet card. When I go to /ect/modules the card that is listed is
> "ne2k-pci.o", there is no irq or io rang.

This is normal. ne2k-pci.o only deals with ne2k chipset. This SMC is a 8139 based chipset. Check this worldwide famous site:

http://cesdis.gsfc.nasa.gov/linux/

> I know that the card is supported under linux, they have a driver on their
> site http://www.smc.com/eznet/drivers/12[] 11/rtl8139.c.txt But I have not a
> clue on how to install it. I am farly technical with computers but am just
> starting out with Linux.

This driver has been written by Donald Becker (almost every network driver is written by him) and, as a tradition, he puts the compile command at the end of the source, so if you sroll down the text from the url you gave above, you'll find this:

compile-command: "gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes
-O6 -c rtl8139.c `[ -f /usr/include/linux/modversions.h ] && echo
-DMODVERSIONS`"

or if you're working with SMP hardware:

SMP-compile-command: "gcc -D__SMP__ -DMODULE -D__KERNEL__ -Wall
-Wstrict-prototypes -O6 -c rtl8139.c `[ -f
/usr/include/linux/modversions.h ] && echo -DMODVERSIONS`"

Cut and paste it the right line at the right place :-)

Just rename this file from rtl8139.c.txt to rtl8139.c before doing this. Be careful of the \r\n problem if you download this file from windows before you transfer it to your Linux box. (Ultraedit can do easily those pretty nice conversions without any headache).

Move the output file to /lib/modules/2.[your.kernel.version]/net. After that, all you have to do is a "modprobe rtl8139" or "insmod rtl8139".

Check that /etc/conf.modules contains this line:

alias eth0 rtl8139

Franck GUILLOIS

documented on: 2000.06.02

Setting NIC speed instead of auto-negotiating 

Newsgroups: comp.os.linux.setup
Date: Wed, 1 Jan 2003 22:41:31 +0100
> > I have a RH8 box set up on a network that serves at 10MB full.  The
> > throughput is horrible, and I think this is a NIC setting issue.
> man ethtool
> Newly packaged with RH8.  It may or may not support your card.
> Otherwise, you'll have to search the 'net for the appropriate flags that
> you can add to /etc/modules.conf.

There's no need to search the web:

# modinfo -p eepro100
debug int, description "debug level (0-6)"
options int array (min = 1, max = 8),
description "Bits 0-3: tranceiver type, bit 4: full duplex, bit 5: 100Mbps"
full_duplex int array (min = 1, max = 8), description "full duplex setting(s) (1)"
congenb int, description "Enable congestion control (1)"
txfifo int, description "Tx FIFO threshold in 4 byte units, (0-15)"
rxfifo int, description "Rx FIFO threshold in 4 byte units, (0-15)"
txdmacount int
rxdmacount int
rx_copybreak int, description "copy breakpoint for copy-only-tiny-frames"
max_interrupt_work int, description "maximum events handled per interrupt"
multicast_filter_limit int, description
"maximum number of filtered multicast addresses"
man modinfo

/usr/src/linux/Documentation/modules.txt for more info about modules.

Following the above example, something like this in /etc/modules.conf, should force 10Mbit/full-duplex.

alias eth0 eepro100
options eepro100 options=16

Michael Heiming

Setting NIC speed instead of auto-negotiating 

> > alias eth0 eepro100
> > options eepro100 options=16
> Interesting...  Seriously, how did you come to that conclusion?

Seriously, look at the source, but it seem to have changed with driver versions, the newer eepro driver wants 'options=0x20' (32) for 10Base-FD.

Anyway I'd suggest loading from the shell, and checking with mii-tool if it works as expected, before editing /etc/modules.conf.

Could be documented better, however some of your equipment is seriously broken, if you need to fiddle around with those settings at all.

Michael Heiming

NETWORKING: LINUX and NETWORK MANAGEMENT 

Black Belt Networking Examples- Policy Routing "With your newly acquired Policy Routing Black Belt you feel you can take on the world. So you decide you want to try some of the outer limits of Policy Routing structures. You start from the consideration of the Triad: Address, Route, and Rule." Read more about LINUX policy routing at http://www.informit.com/newsletter.asp?link=171

documented on: 2001.04.10

QuickSwitch 1.0pre1 

QuickSwitch lets you switch network profiles on the fly (IP address, DNS, routes, NFS shares, etc.). There is a command-line configuration mode by which you can change your entire network setting in one line (including DNS and routing table). It is highly configurable, supports DHCP/BOOTP/NIS/NFS/etc., and also includes a curses-based GUI which you can use as a profile selector on startup.

Homepage: http://quickswitch.sourceforge.net/

freshmeat project page: http://freshmeat.net/projects/quickswitch/