LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   Problems creating LAN (https://www.linuxquestions.org/questions/mandriva-30/problems-creating-lan-412222/)

rrsc16954 02-06-2006 09:09 AM

Problems creating LAN
 
My main computer is running the December 2006 members' edition and I have a good broadband connection. I am trying to share that broadband connection with a second computer running Mandrake 10.1.

I have installed ethernet cards (dedicated Network Adapters according to Mandriva) and have connected them via crossover (twisted) cable.

I have configured the cards in both machines. When I go to 'Internet Connection Sharing' on my connected machine and try to choose eth1 which I have definitely configured several times I get a message

'There is only one configured network adapter on your system:

eth0: Realtek|RTL-8139

I am about to set up your LAN with that adapter.'

If I press 'Continue' I get message 'Potential LAN address conflict found in current config of eth1'.

I have been reading guides and have googled and searched this site but cannot see a remedy. Help, please?

kilgoretrout 02-06-2006 11:45 AM

It's not entirely clear from your post, but to do what you want, you will need two nics in the mandriva 2006 box. You will not use any crossover cables in the network. One nic should be connected to your modem and the second nic should be connected to your mdk10.1 box with a standard cable.
However, if you want to save yourself a lot of aggravation/hassles, just get one of those router/hubs for around $50. Networking/internet connection sharing is a no-brainer with these.

rrsc16954 02-06-2006 08:44 PM

I'm sorry something was unclear in my post. I am trying to share my broadband connection with a second computer via crossover (twisted) cable and 2 dedicated ethernet cards (or NIC's or dedicated Network Adapters). My first box has 2.

Since posting I have tried re-installing on both boxes and have now managed to get 2006 on the 2nd box. I had hoped Mandriva would simply pick up the LAN and do it. It didn't.

Everyone else on the web says 2 NIC's with twisted cable is the easiest way to go with the fastest connection (equal to a switch and much faster than a hub). I have seen this on dozens of websites.

Of course they are talking about using XP on both machines where you just have to call up free software and the job is done.

But it doesn't seem to be impossible to use this same method on boxes running linux - it's just that none of the people who say it is actually tells you how to do it.

There's even a linux how-to which touches on it (ethernet LANS) but looks a bit out of date. It had a button for more recent versions but I got a message saying 'not here anymore'.

The problem seems to be having 2 NIC's on the same linux box. I have seen other queries on help sites pointing in this direction, and that's what my error messages indicate as well.

Since all the previous advice I got said it was a smart and simple thing to do I have spent my money on crossover cable and 2 NIC cards, so I want to get them to work if possible.

kilgoretrout 02-06-2006 09:04 PM

It's probably possible to do that way but I doubt the graphical configuration tools will handle a twisted cable in the mix. In fact, when I did this back in the day, it was common knowledge that graphical network configuration tools almost invariably screwed up when you tried to configure two nics on one box. I always wound up editing the network configuration files by hand to get two nics working with one nic serving as the internet gateway. Once I got a router, I never looked back. Undoubtedly, mandriva has improved their network configuration tools over the last four years, but I doubt they can handle a twisted cable. I also don't understand how that's going to improve performance over a router. What's the logic of it?

bobbelfield 02-07-2006 01:12 AM

What he means by a twisted cable is a null modem cable or crossover cable where the output is connected to the input and input connected to the output.

Thats what I have too and it works well.Mine is a Linux to Windows so I have to use Samba in the Linux box, you dont.

Configure the second card like so
Static setup not DHCP
IP 10.0.0.2 (assuming say the first card is 10.0.0.1)
netmask 255.255.255.0 (or whatever you use on first card )
gateway 10.0.0.1 (this is the one connected to the modem)

Your network is 10.0.0.0

If you use 192.168.0.0 then make the above three sections between the dots suite

rrsc16954 02-07-2006 03:41 PM

Thanks very much for your responses.

bobbelfield: In Mandriva under 'Manage connections' under etho (first card with internet connection) I see

IP 79.195.254.121
Netmask 255.255.255.0
Gateway is blank

Do you mean I should configure eth1 (2nd card for LAN)

IP 79.195.254.122
Netmask 255.255.255.0
Gateway 79.195.254.121 ?

I take it 10.0.0.0 is an example (I think saw on a website that is a private IP for HomeNet).

Mandrake has (last night when I re-installed) automatically installed samba-client, samba-common and smbk4k-0.6.3-1 on my main machine (with 2 cards) and samba client only on the other. I was watching for samba because 1 of the websites I visited said it was needed (or an alternative). So it seems to have noticed the 2 cards. Unusually it didn't make any attempt to configure the network on the main machine.

I've got red lights on both boxes. (Seems that's a good thing, shows you're nearly there - think it shows you've got the right cable for one. Not so good as green, though!)

kilgoretrout: Websites say this kind of LAN is very fast, partly because there are no packet crashes. It's like a dual carriageway data going up one set of wires (inside the cable) and down the other. Apparently in the general ethernet outside in the world packets are colliding all the time and this causes delays. Imperceptible to most of us maybe but it is happening. (I've only read this in the past few days trying to get my little network to go.) I have had experience of a router: when my daughter was living at home she installed HER router between MY broadband and MY computer. Neither of us was getting torrents to upload at more than 4 or 5 kBs or download at more than 10 t0 15 kBs. Since she moved out recently I am getting 45 up and upto 300 or 400 down. I do not want another router but I do want the 2nd box to be able to get updates and also if this works as people say it can I can run azureus on that box and do other things on this one. Just gives me more elbow room!

Thanks again for your time, guys!

bobbelfield 02-07-2006 07:13 PM

Try it anyway..Certainly the second card wont work on the internet unless you put in the gateway address.

Also check /etc/hosts and make sure it looks something like this
127.0.0.1 your_machine_name localhost
79.195.254.121 nameof_first_machine
79.195.254.122 nameof_second_machine

You shouldnt need Samba unless you are going to network with Windows machines which use Server Message Blocks to communicate SMB..hence samba

rrsc16954 02-07-2006 08:37 PM

Hi bobbelfield

My machines have been up and down like yoyos for the past hour or so. It's great watching the green lights flashing on and off when they are booting like they are really going to talk to each other! I don't think I saw that before. It's not going yet. I've tried re-configuring the other machine as well.

I think I will carry on tomorrow. It's a bit late on this side of the world.

I know a lady who has a son in Australia (and another in ?Hong Kong) who came back at this time last year from a holiday in oz and she was so glad to be back out of the 42 degree heat! It's not too bad here now, but it's not that hot!

Seeya!

Emmanuel_uk 02-08-2006 02:28 AM

I suppose you have set up the firewall on eth0 the "client machine"
so it will accept all the packets from eth1 on the server.

I suspect you need dnat (ip_fwd module loaded) on the server at least.
Might be ok by default. I do not know if more firewall settings are needed.

I was planning to do what you are trying, but not had time yet.
So it is interesting to see what experience you can report with this.

rrsc16954 02-08-2006 06:50 PM

Emmanuel_uk: That's a good thought. I did remove Shorewall and the other new bit in 2006 earlier, but since I re-installed the firewall is back and I had forgotten that.

I have not done anything to it today and won't be because I've been out.

BTW how do I set up the firewall like that? I have it set up on the main box to let azureus through. Is it the same?

I will check for dnat tomorrow. Mandriva seems to have taken certain extra steps because of the 2nd card so it may have installed dnat if it is needed.

I did notice last thing yesterday that there was a red 'failed' flag on both machines at 'Stopping NFS Logging'. I have seen a software called nfs something mentioned somewhere when I was googling for info. It was the alternative to Samba I mentioned earlier...

This seems to be a well established method of linking 2 computers (no more!). Even Microsoft has a bit on its website telling you how simple it is with XP.

Thanks again for your time.

bobbelfield 02-08-2006 09:00 PM

As a test, open a console in .122 machine and type
ping 79.195.254.121
The response should be a time if they are connected .
Do the same thing with .121 pinging .122
If they are being stopped it will say host unreachable

Also try the following commands as root
ifconfig
hostname
route
to give you additional info Our temp here is a low of 16C and high of 30C Very pleasant, up near the Great Barrier Reef

Emmanuel_uk 02-09-2006 01:41 AM

I think shorewall is great because of its flexibility.
The drawback is that there is no gui. ;)

Look at /etc/shorewall/rules on the client you might want something of the like
ACCEPT net:79.195.254.121 fw all
ACCEPT fw net all
followed by the final drop statement
Depending on the level of paranoia you could specify ports etc.
Or you could say evthg in and out is accepted from everywhere

I am no specialist of LAN, I can just say maybe
on the server you will need something of the like
DNAT net loc:79.195.254.121 tcp
I have too little knowledge of this. It needs digging up.
I read all the shorewall doc before trying what you are doing, but
I am none the wiser yet. lack of practice :(, and one nic missing.

On the server you may need to create a zone called loc (local)
That is how I understand the theory

In my own word: NFS is one of the protocol to share files between PCs.
If both are linux, forget about samba (at least at first)
You need to have the LAN working before.

As a side thing, once you have the lan working, if you have spare
time look at vnc, you can remotely access graphicaly the other PC
to run command on it. I was impressed by vnc.

rrsc16954 02-09-2006 08:28 PM

bobbelfield:

Here are the readings in the order you asked

Main machine:

eth0 Link encap:Ethernet HWaddr 00:40:F4:B4:A9:42
inet addr:79.195.254.121 Bcast:255.255.255.255 Mask:255.255.255.0
inet6 addr: fe79::240:f4ff:feb4:a942/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:30824 errors:0 dropped:0 overruns:0 frame:0
TX packets:907 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2739642 (2.6 MiB) TX bytes:100374 (98.0 KiB)
Interrupt:5 Base address:0xc000

eth1 Link encap:Ethernet HWaddr 00:E0:4C:AA:16:A1
inet addr:79.195.254.122 Bcast:79.195.254.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:4cff:feaa:16a1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:2289 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:138182 (134.9 KiB)
Interrupt:5 Base address:0xe000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1699 errors:0 dropped:0 overruns:0 frame:0
TX packets:1699 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:107867 (105.3 KiB) TX bytes:107867 (105.3 KiB)

hostname x1-6-00-40-f4-b4-a9-42 (This used to be localhost - I don't know how it changed and can't see now where to change it back?)


Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
79.195.254.0 * 255.255.255.0 U 10 0 0 eth0
79.195.254.0 * 255.255.255.0 U 10 0 0 eth1
default 79-195-254-1.ca 0.0.0.0 UG 10 0 0 eth0



Second machine

eth0 Link encap:Ethernet HWaddr 00:E0:4C:A1:16:F0
inet6 addr: fe79::2E0:4cff:fea1:16f0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:60 (60.0 MiB) TX bytes:438 (438.0 KiB)
Interrupt:11 Base address:0xc000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:560 (560.0 KiB) TX bytes:560 (560.0 KiB)


Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface

I can ping from the main machine to the other (keeps pinging - how do I stop that? apart from shutting shell) but I get 'Network is unreachable' the other way.

I wouldn't mind some of that weather now!

Emannuel_uk: I'm not too good with commands. On the main machine I tried removing the firewall entirely. Still couldn't ping. while that firewall was removed I also disabled the firewall on the other machine, still didn't ping. If it doesn't ping with no firewall I don't think that's it.

I checked to see if dnat was installed, it's not but I think if it was needed Mandriva would have installed it. It has installed enough other stuff since I started.

I think there's something needing to be configured probably on the second machine but I have no idea what.

Since I started this when I go into Mount Points in the Control Centre both machines there's a lot of new buttons to press -

Set NFS mount points
Set SAMBA mount points
Set up Sharing of your Hard Drive Partitions
Manage NFS shares
Manage configuration of Samba
Set WebDAV points

I think these are new - can't remember seeing them before. I've had a look but there's nothing obvious to press.

Thanks again.

Emmanuel_uk 02-10-2006 01:30 AM

cannot help much with the LAN stuff, so this is my small contrib
as root hostname newname
kill ping with <ctrl><c> in the terminal
or ping -c3 ipaddress

Client machine no inet adress (does not bod well for now)
But I do not understand why ping worked
[edit I know now see end of message]

You need more help with all that from bobbelfield and other
You may need dhclient on the client, and dhcpd on the server,
that is some way of ascribing an IP address
(I know to little there, I use dhcpd from my router)

Firewall: I meant one issue to keep in mind. It may crop up at a later stage.

PS: Here a site I use often to learn about LAN stuffs
http://www.linuxhomenetworking.com/w...27s_IP_Address

You may want to look into something of the like on the client
ifconfig eth0 10.0.0.1 netmask 255.255.255.0 up

Private IP Addresses
Some groups of IP addresses are reserved for use only in private networks and are not routed over the Internet. These are called private IP addresses and have the following ranges:

10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255

You have 79.195.254.121 . And that nagged me from the beginning
but I did not check. Now then this is not a private address !
So 79.195.254.122 is not yours on your LAN

79.195.254.121 is given by your cable co
This is OK
but do not disable your firewall on the server

bobbelfield 02-10-2006 02:10 AM

Yes Yes Emmanuel . I see rrsc16954 your on cable?
OK I reread post ¨Potential LAN address conflict found in current config of eth1'¨.
Ok leave config of eth0 as is Go to configure your computer choose reconfigure card-> note gateway address of eth0 ( You said above that there was no gateway on eth0 so I am unsure how your provider is connecting you-probably using DHCP & IPV6 and thats why the name change on your machine but I have no knowledge of that.. hopefully someone else will hop in and tell us
anyhow select eth1 change config to
IP 192.168.0.1
netmask 255.255.255.0
gateway 79.195.254.121 See how that goes .

The tests were to give you an idea of what might be wrong so try them again and previously you were trying to ping the providers site(if above is right) so this should get you going .
Start your browser on the second machine too .

When you can ping from one to the other then you have to set up on each box which Directories and Files you want to share . While in configure your computer->netwok.. select Internet connection sharing and follow the prompts.
Then on same select Manage Host Definitions and make sure that the name of both machines and their addresses 192.168.0.1 and 192.168.0.2 appear

I have not done on Linux to Linux, but when I first started I wanted to get my windows box to talk to my linux box and what with learning all the other stuff it took me 18 months before I had the first session between them. I had to run between them with floppys and CDs Cheers Mate.Be patient, persevere

EDIT-An afterthought don´t forget to go to second machine and put in its
IP 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1
Looks like you´ve got better things to do on the weekend


All times are GMT -5. The time now is 09:51 PM.