ARTICLE

Ask Dr. UN*X
Contributed by Brian Wilson in Network on 2006-03-01 05:35:34
Page 3 of 4

Test the completed setup.

Without rebooting, you can shutdown and restart the complete networking subsystem with these commands from the console. (Doing the 'stop' will cut you off if you are logged in remotely! If you think this is blatantly obvious, you probably have not done it yet. Be careful.)

/etc/init.d/networking stop
/etc/init.d/networking start

You can the use 'ifconfig' by itself to see the state of all available network interfaces. You should see eth0, eth1, and lo. 'Lo' is used internally. If you don't see all three, recheck your configuration files and check the system console, the output of the 'dmesg' command and contents of the log file /var/log/messages for errors.

Once you have everything working here, it's a good idea to reboot the system to make sure everything comes up properly. There are other services that can be affected drastically by changing the state of the network, (for example, your firewall) and you can't really know if it will all come back online correctly without doing a reboot to test it.

Where does that leave us?

You want to have two connections to the Internet. At this point, you have two interfaces but the simple, default routing that is set up will still route all traffic between your system over the old interface on eth0.

Unfortunately, there is no simple one-liner configuration to make the second interface work the way you want it to. Linux will have set up direct routes for the eth1 address space so for example, you can ping your new DSL router if you know the right address.) But, packets coming in from the Internet on the new DSL line right now will come in on eth0 and then be routed out eth0. This is wrong and most often this will fail. You need to use iproute2. That's the topic for my next column.


Final notes:

Finding all modules

Q. How can I tell exactly what network modules are available on my system?

A. You can use the command 'modprobe -l'. This lists the entire filenames; on my system that's 546 lines of output. You can 'grep' for things, for example, listing only network drivers with "modprobe -l | grep drivers/net" reduces the count to just 77 lines.

# modprobe -l | grep drivers/netmodprobe -l | grep drivers/net
/lib/modules/2.4.31-4tr/kernel/drivers/net/3c59x.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/8139cp.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/8139too.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/82596.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/8390.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/acenic.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/aironet4500_card.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/aironet4500_core.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/aironet4500_proc.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/amd8111e.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/appletalk/cops.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/appletalk/ipddp.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/appletalk/ltpc.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/arlan-proc.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/arlan.o
/lib/modules/2.4.31-4tr/kernel/drivers/net/b44.o
.
.
.
many more lines deleted

This output is from a system based on a 2.4 kernel; on a newer, 2.6 kernel the filenames end in '.ko' instead of '.o'. Either way when loading the module, you only use the short name with modprobe, that is, you will use 'modprobe tulip' not 'modprobe tulip.o' or or 'modprobe tulip.ko'.

Knowing the names of the modules, you could in theory load each one and then look at the output of dmesg ('dmesg | tail') each time to see if anything hopeful happened but it would probably be faster to install a hardware discovery system like 'kudzu' or 'discover'.

Note on superuser mode

To execute the critical commands in this article, you have to haves superuser-level permission.

On most systems, you can temporarily grant yourself superuser permissions by typing 'su' and then entering the superuser password when prompted; the prompt will change to a '#'.

On an Ubuntu system, instead of using 'su' mode, you prefix each command with 'sudo', for example when you want to start a network interface you type "sudo ifup eth1" instead of just "ifup eth1".



Article Index
Ask Dr. UN*X
Chipset revealed
Test the completed setup
Resources
 
Discussion(s)
minor improvement regarding the test of
Written by izolan on 2006-03-06 02:42:42
snippet from the article:

Test the completed setup.

Without rebooting, you can shutdown and restart the complete networking subsystem with these commands from the console. (Doing the 'stop' will cut you off if you are logged in remotely! If you think this is blatantly obvious, you probably have not done it yet. Be careful.)

/etc/init.d/networking stop
/etc/init.d/networking start

================= beter solution is =============
/etc/init.d/networking restart

By doing it in this way, you can restart the networking on the REMOTE machine without a fear to be cut off

Discuss! Reply!

Remotely Restarting Network Services
Written by Ron on 2006-03-06 07:31:51
Quote:

From the article:
" Without rebooting, you can shutdown and restart the complete networking subsystem with these commands from the console. (Doing the 'stop' will cut you off if you are logged in remotely! If you think this is blatantly obvious, you probably have not done it yet. Be careful.)

/etc/init.d/networking stop
/etc/init.d/networking start"





Please note I've only tested on a Fedora Core 3 system and I'm not guaranteeing this will work for everyone.

On a fedora core based system you can issue the command:
service network restart
to stop and start the networking services. I tested that command from an ssh session and I didn't even get disconnected!

you can also chain the commands together:
#> /etc/init.d/networking stop; /etc/init.d/networking start

I would recommend remotely logging in, starting a screen session and chaining the commands together so that even if you get disconnected when the network stops, the commands will complete by virtue of the screen session.

As I say, its not a fully tested solution, please use at your own risk.
Discuss! Reply!

Strange Domain name
Written by Allan Registos on 2006-05-06 22:59:40
Hello Dr. UN*X

I have been using Fedora Core 4 for sometime now and got to learn a lot of its features. I am also investigating the features of CentOS and now im using it at the time of this writing. But before all this, we are using a Windows NT 4.0 sp6 server with Exchange 5.5 as an Internet sharing and Email server. The problem is our Windows has been sending a lot of Spams, I think it was infected as a ghost PC. This triggers me to use an alternative OS that is stable and more secure than windows. Aside from the spam generated by the NT server by using a fake address and real address by some employees here, it uses the name ´´ in the from field. When I tried to scan my our IP addresses here, the local IP registered this strange name: indus.cmie.ernet.in !!! .in shows that its from India. And when I run linux and run this command: netstat -tap I can still this domain as affiliated with my local/internal IP:

tcp 0 0 indus.cmie.ernet.in:domain *:* LISTEN 4345/named
tcp 0 0 192.168.0.2:domain *:* LISTEN 4345/named

I am confused why this was so...

Thank you in advance...

Discuss! Reply!