Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Set up network on home headless server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
paul_chany
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2010
Posts: 82
Location: Europe, Serbia

PostPosted: Mon Jun 29, 2015 7:06 pm    Post subject: Set up network on home headless server Reply with quote

Hi,

I have a headless server. This is a power pc box.
I can install on it Gentoo linux by using live-USB.
https://github.com/sakaki-/gentoo-on-b2
I'm stuck with network setup. I can't even set network with live-USB too.

I red Gentoo Handbook and search Gentoo Forum for solution, but none them help me out.
Relevant information of my setup follows.
/etc/conf.d/net
Code:
config_eth0="dhcp"
config_eth1="dhcp"

eth0 is for WAN, eth1 is for LAN.
This headless powerpc box is connected to my cable modem; the cable modem is connected to my ISP. The powerpc box get it's IP address dynamically on eth0, that is, eth0 has not a static IP address.
/etc/resolv.conf
Code:
nameserver 91.102.231.242
nameserver 91.102.231.241

/etc/dhcpcd.conf
Code:
hostname
duid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name               
option classless_static_routes
option ntp_servers
require dhcp_server_identifier
slaac private
nohook lookup-hostname
timeout 30

Code:
/etc/init.d/net.eth0 start

Code:
ping google.com

ping: unknown host google.com
Code:
ping 8.8.8.8

connect: Network is unreachable
Code:
route -n

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
169.254.0.0 0.0.0.0 255.255.0.0 U 2 0 0 eth0
I tried also:
Code:
route add default gw 169.254.0.0 eth0

On this powerpc box I have run previously Debian Jessie and on it I can to set networking.
But here, with Gentoo, I don't know what should I do to solve this problem?

Regards,
Paul Chany
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42587
Location: 56N 3W

PostPosted: Mon Jun 29, 2015 9:21 pm    Post subject: Reply with quote

paul_chany,

You are probably having issues with 'persistant interface naming,

eth0 and eth1 will be the kernal names for your interfaces.
dmesg will show them being renamed by udev.

You will either need to use the 'persistant names', os turn off persistant names and use the kernel names.
Code:
ifconfig -a
will show the interface names.

-- edit --

Hmm, your routing table shows that the above is not correct.
eth0 is listed but not eth1
eth0 has a link local address, which is a self assigned IP address, when a dhcp server cannot be reached.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
paul_chany
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2010
Posts: 82
Location: Europe, Serbia

PostPosted: Tue Jun 30, 2015 9:24 am    Post subject: Reply with quote

NeddySeagoon wrote:
paul_chany,

You are probably having issues with 'persistant interface naming,

eth0 and eth1 will be the kernal names for your interfaces.
dmesg will show them being renamed by udev.

You will either need to use the 'persistant names', os turn off persistant names and use the kernel names.
Code:
ifconfig -a
will show the interface names.

-- edit --

Hmm, your routing table shows that the above is not correct.
eth0 is listed but not eth1
eth0 has a link local address, which is a self assigned IP address, when a dhcp server cannot be reached.

I installed once again Gentoo on this headless server.
Now when I run ifconfig, I get:
Code:
ifconfig -a

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.55.235 netmask 255.255.0.0 broadcast 169.254.255.255
inet6 fe80::222:2ff:fe00:73c prefixlen 64 scopeid 0x20<link>
ether 00:22:02:00:07:3c txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 17 bytes 2226 (2.1 KiB)
TX errors 17 dropped 0 overruns 0 carrier 0 collisions 0

eth1: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 00:22:02:00:07:3d txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device base 0x2000

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


When I'm using my desktop Arch linux, connected to my cable modem ( that is connected to my ISP ), I have the following route table:
Code:
# ip route

default via 95.85.171.254 dev enp0s20 metric 202
default via 95.85.171.254 dev enp0s20 proto dhcp src 95.85.170.202 metric 1024
95.85.170.0/23 dev enp0s20 proto kernel scope link src 95.85.170.202
95.85.170.0/23 dev enp0s20 proto kernel scope link src 95.85.170.202 metric 202
95.85.171.254 dev enp0s20 proto dhcp scope link src 95.85.170.202 metric 1024


So I try to run on my Gentoo system the command:
Code:
route add default gw 95.85.171.254 eth0

SIOCADDRT: Network is unreachable
So I can't run this command. Why?
Code:
lspci

00:00.0 Power PC: Freescale Semiconductor Inc Device 00b0 (rev 10)
00:10.0 Mass storage controller: Silicon Image, Inc. SiI 3114 [SATALink/SATARaid] Serial ATA Controller (rev 02)

There is no messages about any Ethernet hardware?!
But when I had running on this headless server a Debian Jessie system, eth0 and eth1 works fine.
_________________
Best, Pali
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42587
Location: 56N 3W

PostPosted: Tue Jun 30, 2015 5:32 pm    Post subject: Reply with quote

paul_chany,

Code:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.55.235 netmask 255.255.0.0 broadcast 169.254.255.255
inet6 fe80::222:2ff:fe00:73c prefixlen 64 scopeid 0x20<link>
ether 00:22:02:00:07:3c txqueuelen 1000 (Ethernet)

Shows that eth0 is up and has a self assigned link local IP address for both IPv4 and IPv6

Code:
eth1: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 00:22:02:00:07:3d txqueuelen 1000 (Ethernet)
shows that eth1 is not up as the inet and inet6 lines are missing.

dhcpcd assigns a link local IPv4 address when its unable to reach a dhcp server.

This possibly means that your eth0 and eth1 are swapped over. Indeed, they may swap over randomly every boot.
eth1 is probably not up as its not in /etc/init.d

The 169.254.0.0/16 subnet is not routable. Its designated for use in local networks without a router.
Think lan party or ad hoc wireless networking.

Your ethernet harhware is definately working and your kernel driver is loaded too. The interfaces appear it ifconfig -a.
You have a configuration issue, not an installation issue, reinstalling won't help.

You could switch to persistant net names but as a first step, I would connect the LAN to the other network port and restart networking.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
paul_chany
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2010
Posts: 82
Location: Europe, Serbia

PostPosted: Thu Jul 02, 2015 11:53 am    Post subject: Reply with quote

NeddySeagoon wrote:

You could switch to persistant net names but as a first step, I would connect the LAN to the other network port and restart networking.

The 'diagram' of my home network is:
...cable modem that is connected to My Internet Service Provider
...|
...--- Bubba 2's WAN port ( eth0 )
.......|
.......--- Bubba 2's LAN port ( eth1 )
...........|
...........--- Switch
................|
................--- my Desktop Arch linux system
................|
................--- my laptop with Arch linux system

eth0 on Bubba2 should get it's dynamic IP address from my ISP.


Well, after I set eth1 in /etc/conf.d/net:
Code:
# WAN connection: direct to my cable modem
# that is connected to my ISP's server on which
# ISP's dhcpd server gives dynamic IP address for
# my Bubba2 ( B2 )'s eth0
#config_eth0="dhcp"
# LAN: my B2's eth1 is connected to a Switch and other
# home computers are connected to this Switch too
config_eth1="192.168.10.1 netmask 255.255.255.0 brd 192.168.10.254"                                 
routes_eth1="default via 192.168.10.1"

and run
Code:
/etc/init.c/net.eth1 start

* Bringing up interface eth1

my serial console connection freezes.
Moreover I can't ssh into my B2.

When I connect my Desktop Arch linux system directly to cable modem and have connected to the Internet, then I have following network setup:
Code:
ip addr

2: enp0s20: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:1a:92:ce:61:70 brd ff:ff:ff:ff:ff:ff
inet 95.85.171.243/23 brd 95.85.171.255 scope global enp0s20
valid_lft forever preferred_lft forever
inet6 fe80::1c05:5ccd:24e4:25a6/64 scope link
valid_lft forever preferred_lft forever
Code:
ip route

default via 95.85.171.254 dev enp0s20 metric 202
95.85.170.0/23 dev enp0s20 proto kernel scope link src 95.85.171.243 metric 202
95.85.171.254 dev enp0s20 proto dhcp scope link src 95.85.171.243 metric 1024

So I'm stuck here. What can I do further to solve my problem?
_________________
Best, Pali
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42587
Location: 56N 3W

PostPosted: Thu Jul 02, 2015 7:39 pm    Post subject: Reply with quote

paul_chany,

Are there any hints in dmesg?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Thu Jul 02, 2015 7:58 pm    Post subject: Reply with quote

I could help if you put your .config into pastebin, there may be something missing in kernel.
Back to top
View user's profile Send private message
paul_chany
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2010
Posts: 82
Location: Europe, Serbia

PostPosted: Fri Jul 03, 2015 8:11 am    Post subject: Reply with quote

NeddySeagoon wrote:
paul_chany,

Are there any hints in dmesg?

[ 1924.731845] fsl-gianfar e0024000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 2008.836467] fsl-gianfar e0024000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 2118.647292] fsl-gianfar e0024000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 2308.938334] fsl-gianfar e0024000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 2394.828981] fsl-gianfar e0024000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
_________________
Best, Pali
Back to top
View user's profile Send private message
paul_chany
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2010
Posts: 82
Location: Europe, Serbia

PostPosted: Fri Jul 03, 2015 8:27 am    Post subject: Reply with quote

Buffoon wrote:
I could help if you put your .config into pastebin, there may be something missing in kernel.

Code:
mount /boot/
cd /boot/boot/

There are files:
System.map bubba.dtb config uImage .
Pastebin of 'config' file is here:
http://paste2.org/B4NUzc0C
_________________
Best, Pali
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6968

PostPosted: Fri Jul 03, 2015 11:56 am    Post subject: Reply with quote

This is explain here: https://wiki.gentoo.org/wiki/Network_bridge
Back to top
View user's profile Send private message
paul_chany
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2010
Posts: 82
Location: Europe, Serbia

PostPosted: Sun Jul 12, 2015 12:38 pm    Post subject: Reply with quote

A have solved the problem with help of the author of gentoo-on-b2.
( See one of my previous if not the first post in this thread! )
_________________
Best, Pali
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum