LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-02-2017, 01:49 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Rep: Reputation: 255Reputation: 255Reputation: 255
Simple Ad-hoc Ethernet connect between 2 PCS


Hello,

There is here the following hardware:
PC1-RJ45-ETH0 <-----ethernet cable----> PC2-RJ45-ETH3

How would you connect them so that they can see each other on a local 192.168.1.x??

The idea would be to do it with command line:
ifup
ifdown
ifconfig
dhclient

I bought a crossover cable.

my idea :
ifconfig eth0 192.168.1.2
ifconfig eth0 192.168.1.3
and then dhclient on both


Would you have any inputs? I did it in the past, but I cannot remember how I managed.

Thank you

Last edited by Xeratul; 05-02-2017 at 02:07 AM.
 
Old 05-02-2017, 03:36 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,340

Rep: Reputation: Disabled
Running dhclient means you're trying to get an IP address from a DHCP server. In this particular scenario, no DHCP service can be found on the LAN segment, so the DHCP operation will fail.

After a while, dhclient should assign an APIPA link-local IP address to the interface. In other words, the computers should be able to communicate using the automatically assigned 169.254.x.x addresses.

IF you want to use addresses in the 192.168.1.0/24 network, you'll have to assign addresses manually. In fact, that's exactly what you're doing if you run ifconfig as you suggested, so if you just leave dhclient out of it, everything should work.
 
Old 05-02-2017, 07:16 AM   #3
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by Ser Olmy View Post
Running dhclient means you're trying to get an IP address from a DHCP server. In this particular scenario, no DHCP service can be found on the LAN segment, so the DHCP operation will fail.

After a while, dhclient should assign an APIPA link-local IP address to the interface. In other words, the computers should be able to communicate using the automatically assigned 169.254.x.x addresses.

IF you want to use addresses in the 192.168.1.0/24 network, you'll have to assign addresses manually. In fact, that's exactly what you're doing if you run ifconfig as you suggested, so if you just leave dhclient out of it, everything should work.
First, ifdown eth0 and ifdown eth3.

First pc:
Would you think that I should give it, with static:
Code:
# The loopback network interface
# auto lo                          
# iface lo inet loopback
iface eth0 inet static
address 192.168.1.23
Second pc:
Code:
# The loopback network interface
# auto lo                          
# iface lo inet loopback
iface eth3 inet static
address 192.168.1.24

and give 192.168.1.23 to the other one, with static.

Then, on both, to do the ifup eth3 and ifup eth0.

I tried this "interface" file, but it did NOT work

Last edited by Xeratul; 05-02-2017 at 07:55 AM.
 
Old 05-02-2017, 01:55 PM   #4
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Hi Guys,

I have now INTERNET and can surf

I bought a Router to save time, since I needed it. The router does take care of the DHCP server.
I believe that the method I used in the past is outdated. Many forums talk about wlan0 but a crossover ? Today, does it make any single sense to make a backup using a crossover ethernet cable? Future is wifi and high speed transferts. There will be more and more wireless in the future, with more data (waves) going in the air.

I added only :
Code:
iface eth3 inet dhcp 
iface eth0 inet dhcp
[Shall I make it as Thread Solved??]

Last edited by Xeratul; 05-02-2017 at 01:59 PM.
 
Old 05-02-2017, 03:27 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,981

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
Almost no one needs a crossover cable anymore. Almost every nic and router made in the last 15 years has a way to adjust for the patch or crossover cable by the way. They sometimes won't correct unless you power down fully however.

Wireless may be getting faster but so is wired.
 
Old 05-05-2017, 11:51 PM   #6
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by jefro View Post
Almost no one needs a crossover cable anymore. Almost every nic and router made in the last 15 years has a way to adjust for the patch or crossover cable by the way. They sometimes won't correct unless you power down fully however.

Wireless may be getting faster but so is wired.

And, you have nothing against having very high-speed wireless, right? Let's talk in 20 years, again...


Of course, for data backup, the crossover makes sense for home purpose, still today.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't connect to an ad-hoc network in Ubuntu 12.10 daudiam Linux - Newbie 0 12-30-2012 12:44 PM
connect ad-hoc wireless thru laptop to ethernet SaintDanBert Linux - Networking 1 12-30-2012 06:48 AM
Ad-HOC connection via ethernet poltak Linux - Networking 3 08-03-2011 07:38 PM
Cannot connect to ad-hoc WiFi Padawan.AVT Linux - Networking 2 05-14-2009 12:56 PM
connect 2 PCs via ethernet kpachopoulos Linux - Networking 3 05-05-2006 07:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration