How to tweak Linux network files

Getting to the heart of the network configuration
Only two files are left to configure. The first is the network script located in /etc/sysconfig/. This configuration file dictates whether networking will be used and what the hostname will be. The network file takes on the form of: NETWORKING=yes
HOSTNAME="nickel.nater.org"
Last, but not least
The final file to configure is /etc/sysconfig/network-scripts/ifcfg-eth# (where # is the numerical name of the device used for networking). Configurations in this particular file determine which device will be used for networking, which protocol will be used (manual, dhcp, and so on), whether the device will be started at boot, the IP address, the gateway address, the netmask, and, if needed, a number of IPX configurations. The format of this file looks like: DEVICE="eth0"
ONBOOT="yes"
BOOTPROTO="none"
IPADDR="192.168.1.2"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
This information is relatively self-explanatory. The most important thing to remember is to keep everything consistent. Rev it up
With all the configurations in place, it's time to fire up the server. Run the command  /etc/rc.d/init.d/networkstart and, if everything is configured correctly, the OKs will fly by and networking will be up and running. To test networking, run a simple ping command such as ping www.techrepublic.com. If networking fails to work, you can try a couple of quick troubleshooting tips. The first thing to check is the firewall. If the server is using  ipchains, run the command /sbin/ipchains -F and then rerun the ping command. If this doesn't work, run the command /sbin/ipchains -L and make sure that the input policy isn't set to DENY. If it is, run the command /sbin/ipchains --P, input ACCEPT, and then rerun the ping command. If the server is running iptables instead of ipchains, substitute iptables wherever you see ipchains above. If neither of the above commands fix networking, the most obvious place to check (outside of making sure the network, as a whole, is actually up and running) is the NIC module. Make sure the correct module is loaded into the kernel with the  /sbin/lsmod command. If the correct module is not loaded, the server has no way of knowing where and how to throw packets out to the world. If the correct module isn't listed, revisit the first section of this article (NIC modules) and rerun that process. If all else fails...
As a last resort, it is possible to shut down the server, remove the NIC, restart the server (letting the machine detect the removal of the hardware), shut the server down again, reinstall the NIC, reboot the NIC, and configure the NIC when/if prompted. Even if the system does not prompt you to configure the NIC, it should at least detect the installed NIC and load the correct module.
For a weekly round-up of the enterprise IT news, sign up for the Enterpise newsletter. Find out what's where in the new Tech Update with our Guided Tour. Tell us what you think in the Enterprise Mailroom.

Post your comment

In order to post a comment you need to be registered and logged in.

You can also log in with Facebook. Log in or create your ZDNet UK account below

  • Login

Will not be displayed with your comment

By signing up for this service, you indicate that you agree to our Terms and Conditions and have read and understood our Privacy Policy. Questions about membership? Find the answers in the Community FAQ

Get ZDNet UK's daily newsletter

Enter your email address to sign up

ZDNet UK Live

Freebies202

Duplicate comments are not made intentionally. Its very good to know that now you are keeping check on this problem because sometimes a commenter...

7 hours ago by Freebies202 on Microsoft fixes blog comments, speeds up blogs with open source
kevinmchapman

"the very significant number of users" and "many (most) of us" - you have no evidence for these statements. It is a fact that most users are saying...

15 hours ago by kevinmchapman on A tale of two distros: Ubuntu and Linux Mint
Marg Menzies Harrison

Another grammar faux pas is the improper use of "you". When sitting down down in a restaurant, for example, I get cringe when the waitress...

17 hours ago by Marg Menzies Harrison via Facebook on 10 flagrant grammar mistakes that make you look stupid
zdnetukuser

And NOW, folks, for Canonical's next trick... Kubuntu is late. Here's a pencil. Draw your own conclusions. cf.:...

17 hours ago by zdnetukuser on Linux Minterface
Moley

@kevinmchapman. The discussion here reflects the very significant number of users who really do like the traditional menu system and who wish to...

19 hours ago by Moley on A tale of two distros: Ubuntu and Linux Mint
kevinmchapman

Er, no... It is an efficient means of finding the application/file/setting you need in one place. The icons are a simply a fallback for when you...

21 hours ago by kevinmchapman on A tale of two distros: Ubuntu and Linux Mint
TerryRK

Isn't the provision of a text based search an admission by the developers that the mass of icons approach does not work? I don't need to use a...

22 hours ago by TerryRK on A tale of two distros: Ubuntu and Linux Mint
kevinmchapman

"Unity and GNOME 3 both abandon the old text-based cascading menus in favour of a graphical icon-driven system." Point truly missed. Both use a...

23 hours ago by kevinmchapman on A tale of two distros: Ubuntu and Linux Mint
TerryRK

whs001 - Thank you, I'm glad you liked the article. I absolutely agree with you on your first point. I should perhaps have made it clearer that...

23 hours ago by TerryRK on A tale of two distros: Ubuntu and Linux Mint
Dennis Nilsson

If we allow corporate interest to dictate the way our government circumvents due process against foreign entities then we should accept the same...

1 day ago by Dennis Nilsson via Facebook on ACTA stumbles in Germany
GHar123

I totally dislike pirating of works, I fear that artists will be deterred from creating works if they think that they are going to get ripped off....

1 day ago by GHar123 on ACTA stumbles in Germany
JCB33

How dare film makers, artists or anybody that invests in creativity stop us pirating their works for free. I want to be able to walk into my local...

1 day ago by JCB33 on ACTA stumbles in Germany
Moley

@GrueMaster. I prefer horses for courses rather than one size fits all. I, and I suspect most other computer users, do not really wish to have...

1 day ago by Moley on A tale of two distros: Ubuntu and Linux Mint
greycynic

The product that scares me every time I have to use it is the Office 2007 version of Excel. The first bug that I found was applying the median...

1 day ago by greycynic on Ten flawed products that derail productivity
GrueMaster

Nice review and very informative. One thing I'd like to add (in reply to whs001's 1st question), the main reason to have the same interface from...

1 day ago by GrueMaster on A tale of two distros: Ubuntu and Linux Mint
Frederick Wrigley

I'be been using Mint 12 since the RC came out, and I am far more happy with the Cinnamon, the Mate, and, yes (with extensions), theGnome 3...

1 day ago by Frederick Wrigley via Facebook on A tale of two distros: Ubuntu and Linux Mint
bdantas

Excellent article. One small correction, though--although a fresh installation of Linux Mint 12 will, indeed, provide the user with a version of...

2 days ago by bdantas on A tale of two distros: Ubuntu and Linux Mint
Alan Ralph

In related news, the ISPs club together to get the members of the Home Affairs Select Committee (ya goofed on that part, ZDNet UK) copies of "The...

2 days ago by Alan Ralph via Facebook on MPs urge ISPs to take down terrorist material
Alan Ralph

In related news, the ISPs club together to get the members of the Home Affairs Select Committee (ya goofed on that part, ZDNet UK) copies of "The...

2 days ago by Alan Ralph via Facebook on MPs urge ISPs to take down terrorist material
Moley

For Gnome 2 die-hards, it is possible to add icons to the bottom panel (or top top panel, if you prefer) which provide the exact Gnome 2...

2 days ago by Moley on A tale of two distros: Ubuntu and Linux Mint