LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   fedora/redhat: ifcfg-eth0 and ifcfg-eth1 (https://www.linuxquestions.org/questions/linux-networking-3/fedora-redhat-ifcfg-eth0-and-ifcfg-eth1-162399/)

Shaun2222 03-25-2004 05:45 PM

fedora/redhat: ifcfg-eth0 and ifcfg-eth1
 
I'm having some trouble hoping you guys can help.

I Have a machine that i am assinging 2 ips to from 2 seperate networks. Both these ips are on totally diffrent networks are are publicly accessible. I also will have to set the gateway for each network.

Right now the problem i am having is that only the network assinged to eth0 is alive and pinable while eth1 appears to be up but it's not accessible.

Here's my configs...


+ifcfg-eth0 & ifcfg-eth1
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=base.ip.of.machine
NETMASK=net.mask.for.network
GATEWAY=gateway.assinged.to.network


/etc/sysconfig/network has the following

NETWORKING=yes
HOSTNAME=hostname.of.machine
GATEWAYDEV=eth0


Can anybody give me a clue what i'm doign wrong here? route only shows a default gw setup for eth0 and not eth1, also when i add default gw to eth1 it still does not seam to work. At this point i'm wondering if something is wrong else where.

tr4nsfix 03-26-2004 12:21 AM

Whats your output from a 'netstat -rn' ?
You can only have one default gateway... this is where traffic goes if it doesn't know where else to go.

why do you have two real world IPs coming into one box on two seperate interfaces out of curiosity?

Shaun2222 03-26-2004 01:37 AM

I need both public ips to be active for a 2 diffrent services.

216.23.188.61 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
216.23.188.60 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
216.144.233.192 0.0.0.0 255.255.255.224 U 0 0 0 eth1
216.23.188.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 216.23.188.1 0.0.0.0 UG 0 0 0 eth0

tr4nsfix 03-26-2004 12:04 PM

From what I can see eth0 is setup as your default gw currently:
0.0.0.0 216.23.188.1 0.0.0.0 UG 0 0 0 eth0

It also looks like its configured with two IP addresses:

216.23.188.61 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
216.23.188.60 0.0.0.0 255.255.255.255 UH 0 0 0 eth0

Since these two IPs are both on the same subnet you don't need to have both there. Are you turning them both on via an ifcfg-eth config? Maybe you have ifcfg-eth0:0 setup? Either way, get rid of one of them.

on eth1 it looks like you have two networks setup:

216.144.233.192 0.0.0.0 255.255.255.224 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1

which one is the correct one? Do you have eth1 setup with an IP address?
Also keep in mind - I'm not sure what you're trying to do is really feasable. You want to have two Internet connection and use both of them for increased bandwith? Something along the lines of bonded ethernet?

Shaun2222 03-27-2004 03:08 AM

i need both connections becaue one service will be on one network and another service on another. There will be no bonded bandwidth.

As for the 169 address, i'm not sure where that is comming from, it appears that fedora is adding it automatically.

Those 2 ips you are talking about are aliases eth0:1 and eth0:2 there are really 3 ips on eth0 and there will be 3 ips on eth1 as well but for now i'm just trying to get eth1 working.


While screwing with it for a bit i did get eth1 and eth0 pingable for a bit but i dont know how, and when i restart the network and try to figure out how i cant seam to figure it out again.

tr4nsfix 03-27-2004 09:35 AM

You may want to follow this thread also:

http://www.linuxquestions.org/questi...hreadid=162838

It may help you get an idea of why things aren't/won't work even after you can ping each interface.

Shaun2222 03-27-2004 01:22 PM

I think your confused about what i'm trying to do. I am not trying to have a bonded connection between eth0 and eth1. I simply want connections to eth0 to come in eth0 and respoces to be sent out eth0. If the connection comes in eth1 then the responce be sent out eth1. I just want the machine to be alive on both ips. THey dont need to be bonded,loadbalanced,etc.

tr4nsfix 03-28-2004 01:24 AM

thats not a straight forward thing to do... definatly post here if you get it working.

mabao 03-31-2007 12:30 AM

get help
 
[QUOTE=tr4nsfix]Whats your output from a 'netstat -rn' ?
You can only have one default gateway... this is where traffic goes if it doesn't know where else to go.

why do you have two real world IPs coming into one box on two seperate interfaces out of curiosity

my machine is fc6 which is install yestoday,but both the eth0 and eth1 is not alive.I have inserted the right drives modules.Besides,i have done a lot on the configation,such as /etc/sysconfig/network-scripts/ifcfg-eth0 file...... But it doesn't seen to work...
can you help me,please?
my email:
mabaozhizao@163.com
thanks

Spacer76 01-23-2008 03:25 PM

At first sorry to kick this thread up,
The reason to post a reply is for indexing purposes and maybe if the auther hasn't found a way to give some help.

I once did the setup you were talking about.
(2 nic's on a box with different settings, different gateways etc).

The trick is to use different routing tables (search for advanced routing howto).
Also keep in mind a) that you must enable source routing verification in sysctl else nic 1 can give a reply to nic 2 et vice versa.
b) each application on your system must be configged to one nic (=ip/network)
c) if you're using isp's and they block outgoing mail except for their domains then things will be more difficult. The option is to configure for example one sendmail on nic 1/network1 and postfix for example on nic 2/network 2. OR you can try some virtualisation like openvz and let the host machine do the network routing. (which i didn't tried)


All times are GMT -5. The time now is 06:12 AM.