Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Eth0 Eth1 Strange Problems

  • 24-05-2004 7:44am
    #1
    Registered Users, Registered Users 2 Posts: 2,243 ✭✭✭


    Bloody hell linux is a steamy pile of horse poo but I love. And I hate it all at the same time. :)

    I've just installed a new nic in my server (Redhat 9) so that I could setup traffic shaping and what not on my broadband connection.

    The original network card (eth0) was setup on the lan so I didnt bother changing that - I was coing to setup the 3Com (3c905) card on Eth1 as a direct connection to my BB Ethernet Modem.

    So, just to test it out before completely losing net connectivity, I slap both nic's into a port on the LAN, giving both their own ip. (192.168.0.2, 192.168.0.3)

    Anyway, jsut out of interest, I run "ifconfig eth1 down" as well as "ifdown eth1" (I wanted to test both - just in case)

    Lo and behold all connections to my linux box are cut! Wtf?! :confused:
    So I waddle over to the machine, connect up a monitor and keyboard and undo the damge.
    Back to my own PC now and I use a script to take down eth1, sleep for 10 seconds, then bring up both eth nics. This works, but as before all connections are dropped until both nic's are brought back up again!

    I try the same, but taking down eth0 this time.
    "ifconfig eth0 down"
    and all connections to eth1 die, but all connections to eth0 stay alive! :s

    I already found a configuration error that basically said that eth0==eth1==eth0 and fixed it. But now I'm pretty happy that it's all ok!

    Here's the output of my ifconfig -a
    ifconfig -a
    eth0 Link encap:Ethernet HWaddr 00:10:A7:15:1C:00
    inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:257 errors:0 dropped:0 overruns:0 frame:0
    TX packets:97 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:100
    RX bytes:23169 (22.6 Kb) TX bytes:11836 (11.5 Kb)
    Interrupt:10 Base address:0x3000

    eth1 Link encap:Ethernet HWaddr 00:04:75:EF:3B:5D
    inet addr:192.168.0.3 Bcast:192.168.0.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:298 errors:0 dropped:0 overruns:1 frame:0
    TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:100
    RX bytes:30546 (29.8 Kb) TX bytes:4774 (4.6 Kb)
    Interrupt:5 Base address:0xb800

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:118 errors:0 dropped:0 overruns:0 frame:0
    TX packets:118 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:7580 (7.4 Kb) TX bytes:7580 (7.4 Kb)

    as well as my:
    /etc/sysconfig/network-scripts/ifcfg-eth0
    MTU=""
    NETMASK=255.255.255.0
    BROADCAST=""
    GATEWAY=192.168.0.1
    BOOTPROTO=none
    IPADDR=192.168.0.2
    NETWORK=192.168.0.0
    ONBOOT=yes
    DEVICE=eth0
    and my /etc/sysconfig/network-scripts/ifcfg-eth1
    MTU=""
    NETMASK=255.255.255.0
    BROADCAST=""
    GATEWAY=192.168.0.1
    BOOTPROTO=none
    IPADDR=192.168.0.3
    NETWORK=192.168.0.0
    ONBOOT=yes
    DEVICE=eth1

    Also the output of route:
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
    192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
    169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
    127.0.0.0 * 255.0.0.0 U 0 0 0 lo
    default 192.168.0.1 0.0.0.0 UG 0 0 0 eth1

    Can anyone help me out here??

    Thanks,
    Daniel


Comments

  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    You can't use the same subnet for both NICs and expect routing to work correctly. Try using 192.168.0.2 and 192.168.1.2 instead.


  • Closed Accounts Posts: 294 ✭✭eggshapedfred


    whats the output of route when you take eth0 down? it could be that because both interfaces are on the same subnet when you take down one interface the entry for the subnet in the routing table gets removed so any packets going out eth1 don't know where to go.

    not sure if this is the problem you're having but if it is just do a

    route add -net 192.168.0.1/24 dev eth1 (or eth0)

    and you should be back in business.

    hth

    andy


  • Registered Users, Registered Users 2 Posts: 2,755 ✭✭✭niallb


    default 192.168.0.1 0.0.0.0 UG 0 0 0 eth1

    You've just removed your default route, hence no access to anything.
    eth0 must have been set up first, then eth1 and the default route got replaced with eth1 as it was the last one activated.

    It makes very little sense to run both interfaces on the same network. Make life easy for yourself, and change one.
    Keep one NIC for your local network link, and connect
    the other one directly to your broadband.
    That way you get the chance to filter everything.

    NiallB


  • Registered Users, Registered Users 2 Posts: 2,243 ✭✭✭zoro


    Originally posted by niallb
    You've just removed your default route, hence no access to anything.
    It makes very little sense to run both interfaces on the same network. Make life easy for yourself, and change one.
    Keep one NIC for your local network link, and connect
    the other one directly to your broadband.
    That way you get the chance to filter everything.

    That makes alot of sense actually thank you...
    I was simply testing the nic's together by putting them both on the same LAN, I just assumed that it would act as a second "door" into the same machine - I wasn't aware that all of this routing trouble would come up.

    What I actually intend is for eth1 to be connected directly to my router, so the problem would have disappeared itself had I just done that.

    I've just learnt alot about routing though :) thank you all!

    Any more suggestions regarding this setup before I leave the thread to gather dust? :)


  • Registered Users, Registered Users 2 Posts: 2,243 ✭✭✭zoro


    The automatic routing info that it gave itself (assumed) fecked up my whole eth0/eth1 setup.

    And looking back, it's completely right to get fecked up :)

    Anyway, http://www.linuxquestions.org/questions/history/175030 helped me out an awful lot - just in case this thread get's dragged up by some unlucky souls in the future!


  • Advertisement
  • Hosted Moderators Posts: 7,486 ✭✭✭Red Alert


    Just out of interest, what sort of traffic shaping are you up to?


  • Registered Users, Registered Users 2 Posts: 2,243 ✭✭✭zoro


    Honestly? I'm p*ssed off with my sister grabbing all the bandwidth on her beloved mcFly webboards. So I'm limiting that ip address (of the family pc) to maybe 56K dialup speeds ;)

    That way my gaming isn't affected at all :D

    But also I want to to squid proxying and what not to stop her sending mp3's over MSN Messenger. Stupid cow :)


  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    Try upgrading to mySister 2.6.1 - I've heard its much easier to live with.


  • Registered Users, Registered Users 2 Posts: 2,243 ✭✭✭zoro


    Hehe :)

    Ah no, that did sound petty alright though ;)

    I just want to stop either machine from grabbing the full bandwidth every time they try to do something - hopefully I understand enough about it now to attempt it. But probably not :)


  • Hosted Moderators Posts: 2,094 ✭✭✭halenger


    Whinge whinge whine whine.

    Use debian. :p


  • Advertisement
Advertisement