Solved

Need to configure second NIC network card

Posted on 2008-10-04
7
266 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Join & Write a Comment

What is IRC? IRC (Internet Relay Chat) is a form of communication between multiple users. It is available freely to anyone with inernet access. IRC is a great way to communicate with others e.g. There is an IRC channel for Ubuntu Linux, which is fo…
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now