Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Two Ethernet Cards/Two LANs

  1. #11
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Two Ethernet Cards/Two LANs

    I suppose the question remains - does each interface get an appropriate DHCP address so the routing table works? (eth0 in 192.168.1.X and eth1 in 192.168.0.X)
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

  2. #12
    Join Date
    May 2010
    Beans
    20
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Two Ethernet Cards/Two LANs

    I believe the answer to your question is yes. Each router gives a strict bind (permanent IP) to each interface. The IP address for eth0 is 192.168.1.49 and the IP address for eth1 is 192.168.0.155. Whenever the DHCP lease expires, it just renews to the same address.

  3. #13
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Two Ethernet Cards/Two LANs

    I probably just missed it, but which card has internet access? The routing table looks like it should be eth0.
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

  4. #14
    Join Date
    May 2010
    Beans
    20
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Two Ethernet Cards/Two LANs

    That is correct. eth0 is the interface that has Internet access. I will probably try setting eth1 to static again, as I believe DHCP from LAN2's router is making the server drop off the Network Places list once it reassigns the IP address to eth1. The server was showing up on Network Places when I connected LAN2 but has now disappeared.

  5. #15
    Join Date
    May 2010
    Beans
    20
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Two Ethernet Cards/Two LANs

    Update:

    Everything now works! Samba works for both LANs and Squid works for LAN1.

    The only thing that I still need to tweak is server share access speed for LAN2 and making the Ubuntu machine visible in the Network or Network Places on the client machines. The server can be accessed by IP address or even typing the hostname into the address bar, but it is still not showing up in Network Places or Network.

    The other thing that I still need to do is tweak Squid to make sure I have optimal setting for speed.

  6. #16
    Join Date
    Feb 2011
    Location
    Austin, Texas
    Beans
    2
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Two Ethernet Cards/Two LANs

    I had a similar problem that I just fixed and I want to share my solution for the good of everyone. I've seen other posts about similar problems. The original poster here seems to have gotten it working but he's using dhcp for both cards. One of my cards (eth0) gets an IP address from the internet and the other (eth1) is on my LAN and has a static address.

    What seems to happen is both cards come up according to /etc/network/interfaces, but then eth0 gets an address by dhcp and that brings eth1 down.

    My solution was to add a script in rc.local that brings eth1 back up. Because it may take some time for dhcp to work, I had to put in delays.

    I edited rc.local this way:
    #get this machine on the local
    sleep 10 #this delay may not be needed
    hosed=`ifconfig | grep --count "10.10.10.1"` #10.10.10.1 is the static address for eth1
    while [ $hosed -eq 0 ]
    do
    sleep 60 #this time might be tweakable
    ifconfig eth1 down
    ifconfig eth1 10.10.10.1 up
    sleep 60 #this time mighrt be tweakable
    hosed=`ifconfig | grep --count "10.10.10.1"`
    done

    I hope this helps someone.

  7. #17
    Join Date
    Dec 2010
    Beans
    Hidden!

    Re: Two Ethernet Cards/Two LANs

    Quote Originally Posted by Wastrelway View Post
    I had a similar problem that I just fixed and I want to share my solution for the good of everyone. I've seen other posts about similar problems. The original poster here seems to have gotten it working but he's using dhcp for both cards. One of my cards (eth0) gets an IP address from the internet and the other (eth1) is on my LAN and has a static address.

    What seems to happen is both cards come up according to /etc/network/interfaces, but then eth0 gets an address by dhcp and that brings eth1 down.

    My solution was to add a script in rc.local that brings eth1 back up. Because it may take some time for dhcp to work, I had to put in delays.

    I edited rc.local this way:
    #get this machine on the local
    sleep 10 #this delay may not be needed
    hosed=`ifconfig | grep --count "10.10.10.1"` #10.10.10.1 is the static address for eth1
    while [ $hosed -eq 0 ]
    do
    sleep 60 #this time might be tweakable
    ifconfig eth1 down
    ifconfig eth1 10.10.10.1 up
    sleep 60 #this time mighrt be tweakable
    hosed=`ifconfig | grep --count "10.10.10.1"`
    done

    I hope this helps someone.

    Thanks for sharing.

    Thread closed.


    404

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •