Announcement

Collapse
No announcement yet.

How to connect a laptop with 2 network-cards to a network using fstab?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to connect a laptop with 2 network-cards to a network using fstab?

    Hi,
    For some time now I have connected my computers in a network using fstab and smb.conf.
    In smb.conf I share those partitions/folders of the local computer I want to share (i.e. /home/DeMus), make them browseable, not read-only and writable.
    In fstab I mount the shared folders of other computers
    (i.e. //192.168.1.111/home /media/home cifs rw,username=guest,password=,uid=1000,iocharset=utf 8,codepage=unicode,unicode 0 0)

    One thing I have to add is this: in my router I use DHCP but with reservations regarding the addresses. I have connected the mac address of a network-card to a fixed IP-address in the router. So when a computer boots, the mac address is send to the router, looked up in a list and the connected IP-address is used for that computer. Always the same address, which makes it easy to use the mount point in fstab, plus the computers themselves still use DHCP.

    So far it has always worked.

    Now I also have a laptop with a wired and a wireless connection. The wired connection gets .122, the wireless connection always gets .123 at the end of the address.

    Now in the other computers I wrote 2 lines in the fstab file for each shared folder in the new laptop:
    //192.168.1.122/home /media/home cifs rw,username=guest,password=,uid=1000,iocharset=utf 8,codepage=unicode,unicode 0 0
    //192.168.1.123/home /media/home cifs rw,username=guest,password=,uid=1000,iocharset=utf 8,codepage=unicode,unicode 0 0

    Although this works, I still believe there should be a neater way of doing this. I use the laptop both wired and wireless so it can use both addresses alternatively.

    Who can help me with this?

    #2
    Re: How to connect a laptop with 2 network-cards to a network using fstab?

    Looks pretty neat as-is. Why do you think it's too complicated? Since an IP address can't (normally) span multiple physical NICs, your solution appears the be the right way to go.

    Comment


      #3
      Re: How to connect a laptop with 2 network-cards to a network using fstab?

      I don't know, somehow it looks so silly to me to do everything double. But if this is the right way then I will stick to it.
      Thanks.

      Comment


        #4
        Re: How to connect a laptop with 2 network-cards to a network using fstab?

        Well, they aren't exactly double, since the IP addresses are different. Think of an IP address as the identifier of a network connection, not as the identifier of a computer. Because most computers have only one network connection, it's easy to regard an IP address as a computer identifier. But when a computer has multiple network connections, you can see that IP = computer no longer applies.

        Comment


          #5
          Re: How to connect a laptop with 2 network-cards to a network using fstab?

          You can use Link Aggregation aka Port Bonding aka to assign multiple ports a single IP but I've never tried it using a wireless port. I use it on my desktop for transfer speed as my server also has two ETH ports. I use Round-Robin Policy which allows load balancing as long as both ports are up and falls back to a single port connection if one fails.

          The advantage to bonding - besides not having to configure multiple overlapping fstab mounts - is once connected, if one device fails (becomes unconnected) the mount would not fail or freeze. In fact, an on going transfer would continue unaffected - only slower.

          A disadvantage in this case could be if you selected the wrong Link Policy you could be stuck at the speed of the slowest device.

          I totally agree with Steve - if your current setup works well, don't break it! But I gave you the above info on the off chance you were looking for a learning experience...

          Please Read Me

          Comment


            #6
            Re: How to connect a laptop with 2 network-cards to a network using fstab?

            Port bonding? At home? What...can't get 10gigE fiber pulled into your living room?

            I bet you heat your house with an AS/400 lurking in your basement.

            Comment


              #7
              Re: How to connect a laptop with 2 network-cards to a network using fstab?

              I think I might be a speed junkie...

              To be totally honest, I built 2 computers about 7 years ago, noticed they had both two ethernet ports and I wondered why and how I could use them. I researched and found out about bonding.

              My whole house is wired for ethernet because old (100 years this year) houses use knob-and-tube wiring. Current passing through parallel wires creates a magnetic field. These wires are roughly 18 inches apart, thus the field stretches to 4.5 feet wide and is scattered all over the house. There results of this is you may find a great wifi connection somewhere, only to have it totally disappear if you shift two or three feet.

              When I built my server - I made sure it had two ethernet ports too. Then when I hooked them all together, I noticed my desktop and the server comunicated fast and the other computer (my son's) connection was not any faster. I then figured out his was in a different room and was connected to a remote switch whereas the server and my desktop were connected to the same switch. Seems bonding doesn't pass through a dumb device. Yada, yada, yada... I bought a 16-port switch with jumbo frames and we both had blazing transfers to and from the server. Un-managed switches aren't hideously priced and I bought 1000 ft. of cat5e when I started wiring the house so a second cable run didn't hurt a bit.

              In practical use, I don't really know how much I benefit. I use my desktop to access my server continually and do cross-backing up and so on so there is some benefit. The main reason is "because it is there" 8)


              Please Read Me

              Comment


                #8
                Re: How to connect a laptop with 2 network-cards to a network using fstab?

                Originally posted by oshunluvr
                old (100 years this year) houses use knob-and-tube wiring. Current passing through parallel wires creates a magnetic field. These wires are roughly 18 inches apart, thus the field stretches to 4.5 feet wide and is scattered all over the house.
                My 1920s-era house in Ohio had that, too...but it had been disconnected long ago. I never bothered finding out what all that cabling strung through the attic was for. Now I know -- thanks.

                Originally posted by oshunluvr
                The main reason is "because it is there" 8)
                I suspected this might be the real reason

                Comment

                Working...
                X