LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-06-2004, 09:37 AM   #1
petecg_76
LQ Newbie
 
Registered: Apr 2004
Posts: 2

Rep: Reputation: 0
Unhappy 2 Networks for the same NIC??


Hi,

I'm trying to setup 2 networks in the same NIC (eth0) in my RH7.3 box.
Let's say that one those addrs should be assigned by DHCP and the other one being static.

I tried to enter both configurations in /etc/sysconfig/network-scripts/ifcfg-eth0 but it did not work. Only the last configuration in that file was applied.

I tried as well with one solution I found by *googling* around but it seemed confusing for me and it did not work either. (Try "Re: Two networks on one card" in google)

I consider myself a complete newbie at linux, although relatively experienced with networking and computers...


anyone has done this before??
Thanks,

P.
 
Old 04-06-2004, 02:52 PM   #2
bentman78
Member
 
Registered: Mar 2003
Location: Washington DC, USA
Distribution: Redhat
Posts: 212

Rep: Reputation: 30
not sure what your trying to acheive, but this will give the apperance of "two" ip addresses for the same NIC

# ifconfig eth0:1 192.168.0.2 netmask 255.255.255.

next go into the /etc/hosts file and add an entry for the I.P address and host name.

To make this permanent in RedHat go to /etc/sysconfig/network-scripts -- you'll see a file there called ifcfg-eth0. Copy that file and edit it to create one called ifcfg-eth0:1 Edit the contents of the file to give it the right address and netmask. Now your eth0:1 interface will start automatically at reboot, just like eth0 itself.

Next you have to add a route so it can pass traffic. do this:

# route add -net 192.168.0.0 netmask 255.255.255.0

Linux will now be able to route "traffic" from that interface.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
eth0 NIC Card Not Working! 3com 3c501 NIC. Mustard010 Linux - Networking 16 08-15-2007 02:22 AM
multiple IPs, one NIC, different networks branden_burger Linux - Networking 3 03-15-2005 07:24 AM
troubles getting Gigabit NIC to work in slack 10 (HGA32T NIC) TheLinuxDuck Slackware 10 03-10-2005 04:37 PM
2 External Nic, 1 Internal Nic Router Problem trevanda Linux - Networking 0 10-13-2004 01:20 AM
1st nic regular FTP, 2nd nic SSH Riselong Linux - Distributions 2 02-02-2004 05:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration