You are not logged in.

#1 2022-02-17 20:58:44

yuanhao
Member
From: Edinburgh, UK
Registered: 2021-11-12
Posts: 68
Website

About IP address in local network

Maybe this is not about arch linux but I am a newbie and really need help on this...

I have two computers (Arch and Ubuntu), and I disconnect them from internet, then connect them by a Ethernet cable since I think this we I can have a local network?
but the Ethernet cable is not lighting and I can not ssh to each other since I don't know the ip address of each other.
I tried ip addr command and didn't find ip address, and I also tries 127.0.0.1 and 192.168.1.1 and neither works.

I do this because I see some one on youtube do this with a raspberry pi with a freshly installed openwrt, so I bought a SBC but install Unbuntu to do the same..... but not working, this is the video: https://www.youtube.com/watch?v=jlHWnKVpygw&t=278s
any suggestions?

Offline

#2 2022-02-17 21:24:39

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,044

Re: About IP address in local network

He's doing that w/ a router-turned raspi - and depending on the ethernet standard available, you'll require a https://en.wikipedia.org/wiki/Ethernet_crossover_cable
Though I gather you're trying to connect your PC to as rasperry pi, too?

since I don't know the ip address of each other

You'll have to set them: https://wiki.archlinux.org/title/Networ … IP_address

since I think this we I can have a local network?

You have a  local network if your systems are connected to the same switch (which is likely part of the consumer router you're likely using when talking about "internet")?
=> What's your actual goal here?

Offline

#3 2022-02-17 22:17:53

yuanhao
Member
From: Edinburgh, UK
Registered: 2021-11-12
Posts: 68
Website

Re: About IP address in local network

seth wrote:

He's doing that w/ a router-turned raspi - and depending on the ethernet standard available, you'll require a https://en.wikipedia.org/wiki/Ethernet_crossover_cable
Though I gather you're trying to connect your PC to as rasperry pi, too?

since I don't know the ip address of each other

You'll have to set them: https://wiki.archlinux.org/title/Networ … IP_address

since I think this we I can have a local network?

You have a  local network if your systems are connected to the same switch (which is likely part of the consumer router you're likely using when talking about "internet")?
=> What's your actual goal here?

Ok, sounds complicated XD
So does this mean if I choose to use ubuntu and arch I will use a crossover cable and if one of them is a router system like openwrt then i can do with normal Ethernet cable?
And for setting the ip address, according to my (poor) knowledge, is that being assigned by the router? why do we bother change them?

For the goal, I am just playing around to try everything.. and if possible I want to make a router out of my sbc and also set it as a vpn server so that I can leave it on 24 hours and connect to its local network when I am not in home

Offline

#4 2022-02-17 22:31:48

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,044

Re: About IP address in local network

So does this mean if I choose

wikipedia wrote:

Many network devices today support auto MDI-X capability, wherein a patch cable can be used in place of a crossover cable, or vice versa, and the receive and transmit signals are reconfigured automatically within the device to yield a working connection.

https://man.archlinux.org/man/extra/eth … htool.8.en

And for setting the ip address, according to my (poor) knowledge, is that being assigned by the router? why do we bother change them?

What router?

I disconnect them from internet

This one?
The IP needs to be provided by something - if that's not a dhcp server, you'll have to setup a static IP.

I want to make a router out of my sbc and also set it as a vpn server

Why do you want to use ubuntu for this instead of a dedicated router OS, esp. since you seem to have limited background knowledge?
ftr, https://wiki.archlinux.org/title/Router
But also https://openwrt.org/docs/guide-user/ser … vpn/server

Offline

#5 2022-02-17 22:38:57

jonno2002
Member
Registered: 2016-11-21
Posts: 887

Re: About IP address in local network

its not complicated at all.

if your connecting 2 computers with 1 cable and no router/switch you will need a crossover cable and you will also have to assign ip addresses manually.

if your connecting 2 computers with 2 cables and a router/switch in the middle you dont need a crossover cable and the router/switch will hand out ip addresses automatically using DHCP.

so you want to use the 2nd option id say.
also if you plan on having your network accessible from the web please do ALOT of research and set it up securely, use keypairs for authentication and use non standard ports, if you dont know what this means then you should NOT be doing it !

Offline

#6 2022-02-17 22:50:42

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: About IP address in local network

jonno2002 wrote:

if your connecting 2 computers with 1 cable and no router/switch you will may need a crossover cable

All gigabit adapters support Auto MDI-X which will automatically configure devices that are directly connected with no need for a crossover cable.
A crossover cable may be required for 10BASE-T/100BASE-TX adapters depending on which MDI protocols they support.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2022-02-17 22:55:37

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,690

Re: About IP address in local network

jonno2002's option 2 will work with a 'router' that provided a DHCP server; this is common in home routers.   A switch will not work.
Option 1.5 would be to use a switch, but you will need to use static IP addresses.
The best solution would be to set up a DHCP server on your Arch box, and have it issue addresses to things that connect to it.

Modern systems, however, really don't need a crossover cable most of the time.
With the two boxes connected, what is the output of ip addr on the Arch box?   And on the Ubuntu box?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#8 2022-02-17 22:55:57

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: About IP address in local network

jonno2002 wrote:

if your connecting 2 computers with 2 cables and a router/switch in the middle you dont need a crossover cable and the router/switch will hand out ip addresses automatically using DHCP.

A router and a switch are two different things. Yes, most consumer grade routers will have a switch built in, but they still perform separate functions. Connecting through a switch would still need IP addresses assigned manually; you have to have a a dhcp server in there somewhere for it to be automatic, usually done by the router.

Last edited by Scimmia (2022-02-17 22:56:38)

Offline

#9 2022-02-17 23:30:13

jonno2002
Member
Registered: 2016-11-21
Posts: 887

Re: About IP address in local network

wow ok i thought i might get picked apart for that line, i know a typical switch doesnt handle dhcp but most people only have the router/switch they were provided by their isp. so when i said router/switch i was referring to the common router with built in switch hence the "router/switch", i realise it can be read wrong so my bad.

also shows how oldschool i am by not knowing that gigabit had auto switching.

Last edited by jonno2002 (2022-02-17 23:34:13)

Offline

#10 2022-02-19 11:31:29

yuanhao
Member
From: Edinburgh, UK
Registered: 2021-11-12
Posts: 68
Website

Re: About IP address in local network

Thank you all guys, just for an update, since I don't have a crossover cable, whatever that is... and I don't have enough knowledge in this area, I choose to use openwrt for my SBC ( so I delete ubuntu).
And then I plan to connect two as the previous way, but I notice that in my openwrt, in the file /etc/config/network

config interface 'wan'
        option ifname 'eth0'
        option force_link '1'
        option proto 'dhcp'
        option metric '200'
        option dns '8.8.8.8'
        option peerdns '1'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option ipaddr '172.23.0.1'
        option netmask '255.255.255.0'
        option ifname 'usb0 eth1'

I don't know what code this is, but I can guess that the SBC is offering lan using wlan0 and usb0, but eth0 is used to connect to wan (internet)?
so I changed the file to this

config interface 'lan'
        option proto 'static'
        option ifname 'eth0'
        option ip6assign '60'
        option ipaddr 'a,b,c,d' # I change to random number
        option netmask '255.255.255.0'
        option force_link '1'

and delete the 'wan' code, so I think this will make eth0 (SBC's ethernet port) to offer lan?
Then I connect SBC to my Arch desktop, it works, It now canssh to the ipaddr I set above and even can use browser to open it

And I also have a question: in my arch desktop, in the enp4s0 connection ipv4 configuration, I can choose manual and automatic (kde), both of those works (for manual i just set the gateway and netmask to the ipaddr I set above, and ip just change the last digit of gateway),
but why automatic works, I didn't specify in the SBC, that I will use dhcp, as you can see in the above file, but when I set to automatic in arch, it just automatically has an ip.

Since it works, is my guess above correct?
So my next step plan now is to have SBC's Ethernet port and its own wlan0 offer lan, and the by a usb wifi adapter, connect to usb (usb0)  and set it to be connected to wan(internet), so that I can have a router?

Last edited by yuanhao (2022-02-19 11:39:25)

Offline

#11 2022-02-19 17:05:48

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,690

Re: About IP address in local network

jonno2002 wrote:

wow ok i thought i might get picked apart for that line, i know a typical switch doesnt handle dhcp but most people only have the router/switch they were provided by their isp. so when i said router/switch i was referring to the common router with built in switch hence the "router/switch", i realise it can be read wrong so my bad.

First off, no picked you apart; we picked apart your idea.  These are technical forums and the information you provided was ambiguous and two of us almost simultaneously noted that because any assumptions made at this point would have taken us down the wrong branch of the fishbone diagram.   We needed to determine two things; whether there is automatic cross over being performed (often down by a switch) and whether there was a DHCP server -- not really the job of a router, but many home appliances called 'routers' combine the functions of routers, switches, samba servers, access points, etc...

We attempted to remove the ambiguities

Edit: BTW:  https://en.wikipedia.org/wiki/Crossover_cable

Last edited by ewaller (2022-02-19 17:07:20)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#12 2022-02-19 17:13:21

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,690

Re: About IP address in local network

So, you are running openwrt on the SBC.  That will cause the SBC to behave like a home router appliance.   How many wired Ethernet ports does it have?  Does it have WiFi?   In this mode, I'd expect it to try to connect to an upstream device with an Ethernet port (connect to cable modem), would act as a WiFi access point on a local LAN, would provide DHCP services for the LAN, and would provide routing for any remaining wired Ethernet ports.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB