Solved

Need to configure second NIC network card

Posted on 2008-10-04
7
269 Views
Last Modified: 2013-12-23
I need to configure two cards in my Linux system: one connected to the local lan and one connected to the Internet. Does anyone have any expertise on this at the ifconfig and route add level? I've tried posting this twice before with no luck. If there is a taker, I will post details of my configuration.
0
Comment
Question by:jmarkfoley
7 Comments
 
LVL 5

Expert Comment

by:sciphre
ID: 22640765
Sounds like a very common setup, can you please explain what you intend for this to achieve?
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 22640769
what linux system do you have?

most come with setup command that let you configure network cards
0
 
LVL 3

Expert Comment

by:cnjuguna
ID: 22641271
ifconfig and route will work as long as you do not reboot your system. for more permanent results you wil need to use a configuration program or directly edit some files.

pls post more info. linux version and your final scenario for farther assistance.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 12

Expert Comment

by:ibu1
ID: 22643521
From the above question I guess that u have problem with route add command.Below is the very good example for route add and how to make is persistant after rebooting the system:
echo "ip route add 172.16.0.0/24 via 192.168.0.3" >> /etc/rc.local
echo "ip route add 192.168.5.0/24 via 192.168.0.3" >> /etc/rc.local

THis is a very good method of appending lines to the /etc/rc.local file in linux. This file is like a autoexec.bat file and is executed every time you reboot. So next time you reboot, these two lines (i.e. the text inside the quotes.) will be present in this file and thus will be executed and you will again have your routes setup.


Cheers
0
 
LVL 5

Expert Comment

by:sciphre
ID: 22647409
ibu1: that's a very good way of doing it wrong.

You should always use the distribution's configuration files, unless you don't like the distribution.
In which case you should be using one you like.

One of the more obvious reasons why doing network initialization in rc.local is wrong is that rc.local is always the LAST file called.
Which means that your network will not be up when you're running firewall settings, daemon initialization, etcetera.
Some of these programs are often set up to "require network" and always make sure the networking scripts get run before they do. Guess what happens when you're not using the networking scripts.
The second obvious reason for why doing it in rc.local is wrong is the fact that you completely lose hotplug support and configurable reinitialisation.

Finally, reinventing the wheel and making it square in the process is just silly.
0
 
LVL 1

Accepted Solution

by:
jmarkfoley earned 0 total points
ID: 22745562
Gentlemen, thank you for your input, but I figured it out. The problem turned out to be none of the above.  The solution turned out to be that I needed to configure my NIC addresses in /etc/udev/rules.d/75-network-devices.rules, which is apparently new for slackware 12.0. When I did that, everything ran just fine and I didn't have to add routes or any such thing.
0
 
LVL 12

Expert Comment

by:ibu1
ID: 22747222
The comment I posted above is working very well in my network.I don't know the reason behind this comment posted by the author :-ibu1: that's a very good way of doing it wrong.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question