LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   2 Nics problem: Eth1 disabled Eth0 (https://www.linuxquestions.org/questions/linux-networking-3/2-nics-problem-eth1-disabled-eth0-638252/)

YAOMK 04-27-2008 04:09 PM

2 Nics problem: Eth1 disabled Eth0
 
I have very limited experience networking with multiple interfaces, so please bear with me. The issue is that Eth0 seems to have been disabled, I cannot connect/ssh to it directly, but I can connect to it's designated ip through eth1. This is what ifcfg-ethX looks like:

Eth0:

Code:

# ADMtek NC100 Network Everywhere Fast Ethernet 10/100
DEVICE=eth0
HWADDR=00:18:f8:0e:95:60
BOOTPROTO=static
IPADDR=192.168.7.6
NETMASK=255.255.255.0
GATEWAY=192.168.7.1
ONBOOT=yes
TYPE=Ethernet

Eth1:

Code:

# Broadcom Corporation BCM4401 100Base-T
odcom Corporation BCM4401 100Base-T
DEVICE=eth1
HWADDR=00:0b:db:c0:f6:c0
BOOTPROTO=static
IPADDR=192.168.7.5
NETMASK=255.255.255.0
GATEWAY=192.168.7.1
ONBOOT=yes
TYPE=Ethernet

#lspci -tv:

Code:

-[0000:00]-+-00.0  Intel Corporation 82845G/GL[Brookdale-G]/GE/PE DRAM Controller/Host-Hub Interface
          +-02.0  Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device
          +-1d.0  Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1
          +-1d.1  Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2
          +-1d.2  Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3
          +-1d.7  Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller
          +-1e.0-[0000:01]--+-04.0  ADMtek NC100 Network Everywhere Fast Ethernet 10/100
          |                +-05.0  Conexant Unknown device 2702
          |                \-09.0  Broadcom Corporation BCM4401 100Base-T
          +-1f.0  Intel Corporation 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge
          +-1f.1  Intel Corporation 82801DB (ICH4) IDE Controller
          +-1f.3  Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller
          \-1f.5  Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller

I'm trying to setup this machine as a transparent proxy. Thanks.

jailbait 04-27-2008 04:39 PM

During boot udev dynamically configures your hardware. You can permanently change what udev does in one of the files in the /etc/udev/rules.d directory. Which file contains the network configuration rules varies from distribution to distribution. Here is an explanation of how it is done in Slackware:

http://www.linuxquestions.org/questi...ight=eth0+eth1

I use Debian. My network configuration is set in /etc/udev/rules.d/z25_persistent-net.rules The contents of my file are:

Code:


# This file was automatically generated by the /lib/udev/write_net_rules
# program, probably run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# MAC addresses must be written in lowercase.

# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:1b:2f:2f:13:aa", NAME="eth0"

# PCI device 0x1039:0x0900 (sis900)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:d0:09:d7:5a:d4", NAME="eth1"

I suggest that you look in your /etc/udev/rules.d/ directory for a file that describes your network configuration and change that file to suit your needs. If you can't find the file you might be able to create a file using mine as a pattern. If those ideas don't work then I suggest that you search LinuxQuestions for a thread that describes how your distribution sets up the file.

-------------------
Steve Stites

YAOMK 04-27-2008 05:06 PM

Thanks for your prompt response Jailbait. I'm using Centos 5.0. I found 2 files of interest under the rules.d directory:

60-net.rules:
Code:

ACTION=="add", SUBSYSTEM=="net", IMPORT{program}="/lib/udev/rename_device"
SUBSYSTEM=="net", RUN+="/etc/sysconfig/network-scripts/net.hotplug"

60-pcmcia.rules:

Code:

# PCMCIA devices:
#
# modprobe $modalias loads all possibly appropriate modules
ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \
                RUN+="/sbin/modprobe $modalias"

# Very few CIS firmware entries (which we use for matching)
# are so broken that we need to read out random bytes of it
# instead of the manufactor, card or product ID. Then the
# matching is done in userspace.
ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \
                RUN+="/sbin/pcmcia-check-broken-cis"

# However, the "weak" matching by func_id is only allowed _after_ modprobe
# returns, so that "strong" matches have a higher priority.
ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \
                RUN+="/bin/sh -c 'echo 1 > /sys/$devpath/allow_func_id_match'"

# PCMCIA sockets:
#
# modprobe the pcmcia bus module so that 16-bit PCMCIA devices work
ACTION=="add", SUBSYSTEM=="pcmcia_socket", \
                RUN+="/sbin/modprobe pcmcia"

# if this is a PCMCIA socket which needs a resource database,
# pcmcia-socket-startup sets it up
ACTION=="add", SUBSYSTEM=="pcmcia_socket", \
                RUN+="/sbin/pcmcia-socket-startup"

I'm not sure in which of these files I should add the Eth0, Eth1 rules.

jailbait 04-27-2008 05:11 PM

Quote:

Originally Posted by YAOMK (Post 3134885)

I'm not sure in which of these files I should add the Eth0, Eth1 rules.

I would try 60-net.rules.

--------------------
Steve Stites

P.S. I have CentOS 5.0 installed also and i have never had any network problems with it. My 60-net.rules file is the same as yours. My network configuration is different in that I only have eth0 installed. So maybe if you explicitly configure eth0 and eth1 in 60-net.rules maybe CentOS won't get them confused.

YAOMK 04-27-2008 05:58 PM

When I tried to configure the transparent proxy, I did some redirection by appending rules to my iptables nat table. I tried to flush these rules by #iptables -F, and then followed your instructions but still Eth0 doesn't respond. I guess I'm going to do a clean install of CentOS and go from there. Thanks for all your help.

UPDATE: Alright, I got it working. The issue was that both interfaces were working under the same netmask. The following post explains it in detail. Now If I could figure out how to get eth0 to use DHCP to connect to the cable modem instead of using eth1 and acquiring an ip from my access point's dhcp!!!!! Any takers?

slackster 11-30-2008 04:11 AM

Quote:

Originally Posted by YAOMK (Post 3134919)
When I tried to configure the transparent proxy, I did some redirection by appending rules to my iptables nat table. I tried to flush these rules by #iptables -F, and then followed your instructions but still Eth0 doesn't respond. I guess I'm going to do a clean install of CentOS and go from there. Thanks for all your help.

UPDATE: Alright, I got it working. The issue was that both interfaces were working under the same netmask. The following post explains it in detail. Now If I could figure out how to get eth0 to use DHCP to connect to the cable modem instead of using eth1 and acquiring an ip from my access point's dhcp!!!!! Any takers?

Sure, just use your dhcp-client command of choice (i.e. dhclient, dhcpcd, etc.) and add your interface name behind it:

# dhclient eth0


All times are GMT -5. The time now is 01:45 AM.