View previous topic :: View next topic |
Author |
Message |
orion777 Apprentice

Joined: 15 Mar 2017 Posts: 207 Location: Riga, Latvia
|
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55178 Location: 56N 3W
|
Posted: Sat Jul 21, 2018 9:55 am Post subject: |
|
|
orion777,
Choose NetwerkManger or the init scrips. Trying to use both will get you in a mess as they are unaware of each other.
The interface names are not important. Discover what they are and use them consistently everywhere.
I prefer the kernel naming because that's what I learned a long time ago.
The "Persistent Device Naming" has just swapped one set of corner cases for another. Its just different rather than an improvement.
Both ways work and are equally correct. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
orion777 Apprentice

Joined: 15 Mar 2017 Posts: 207 Location: Riga, Latvia
|
Posted: Sun Jul 22, 2018 5:56 am Post subject: |
|
|
So I can use eth0 / wlan0 names in the scripts, right?
I will try to use your gentoo on rpi3 to build the router with MPTCP implementation, want to see will it work or not. |
|
Back to top |
|
 |
charles17 Advocate

Joined: 02 Mar 2008 Posts: 3686
|
Posted: Sun Jul 22, 2018 7:45 am Post subject: Re: Network configuration from the gentoo handbook? |
|
|
orion777 wrote: | However, network configuration file /etc/conf.d/net , as required by the handbook |
should be provided by netifrc. |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55178 Location: 56N 3W
|
Posted: Sun Jul 22, 2018 9:53 am Post subject: |
|
|
orion777,
To get the old names add to the kernel command line.
On a Raspberry Pi you will get the old names anyway as the Persistent Device Names depend on the PCI bus IDs.
The Pi does not have PCI.
MPTCP implementation?
That's been done on a Pi. From memory someone was using two 4G sticks and the kernel MPTCP patch. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
orion777 Apprentice

Joined: 15 Mar 2017 Posts: 207 Location: Riga, Latvia
|
Posted: Mon Jul 23, 2018 5:34 pm Post subject: |
|
|
NeddySeagoon wrote: | orion777,
To get the old names add to the kernel command line.
|
Okay, where to specify? In the /boot/config.txt string net.ifnames=0 gives no effect.
Also please note than ifconfig -a returns same eth / wlan like names..
Quote: | MPTCP implementation?
That's been done on a Pi. From memory someone was using two 4G sticks and the kernel MPTCP patch. |
Yes, I know this guy! That was me But please be careful that when mptcp kennel and modulesinstall were used, old (standard) kernel will not work as it should be (also has been testen on laptop with grub) |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55178 Location: 56N 3W
|
Posted: Mon Jul 23, 2018 7:02 pm Post subject: |
|
|
orion777,
It would go in /boot/cmdline.txt on a Pi but its not required.
There is nowhere to get the Persistent Interface names from so you will always have ethX and wlanY style names anyway. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
krinn Watchman


Joined: 02 May 2003 Posts: 7471
|
Posted: Mon Jul 23, 2018 7:38 pm Post subject: |
|
|
Ok so it's not need for that user, but for the story:
Code: | ls /sys/class/net
eth0 lo
ls /etc/udev/rules.d/ -l
...
-rw-r--r-- 1 root root 0 27 juil. 2017 80-net-name-slot.rules
dmesg | grep command
[ 0.000000] Kernel command line: clocksource=hpet root=/dev/sdb2 pti=on
[binary R ] sys-fs/eudev-3.2.5::gentoo USE="hwdb introspection kmod -rule-generator (-selinux) -static-libs {-test}" ABI_X86="32 (64) (-x32)" 0 KiB
|
So still good with the empty file too. |
|
Back to top |
|
 |
orion777 Apprentice

Joined: 15 Mar 2017 Posts: 207 Location: Riga, Latvia
|
Posted: Tue Jul 24, 2018 8:37 am Post subject: |
|
|
Good day! Now I can't force name server to work.. Static or DHCP configuration returns same result (NetworkManager has been removed from rc)
Code: | pi64 ~ # ping google.lv
ping: google.lv: Temporary failure in name resolution
pi64 ~ # cat /etc/conf.d/net
#eth0
#config_eth0="dhcp"
config_eth0="192.168.1.115 netmask 255.255.255.0"
routes_eth0="default via 192.168.1.1"
dns_servers_eth0="8.8.8.8 8.8.4.4"
|
|
|
Back to top |
|
 |
younggeorge n00b

Joined: 25 Jul 2018 Posts: 1 Location: California City, CA, USA
|
Posted: Wed Jul 25, 2018 12:04 pm Post subject: Gento Handbook |
|
|
Gentoo's RC system now knows about that interface. All the network interfaces are configured in /etc/conf.d/net. Below is a sample configuration for DHCP and static addresses. |
|
Back to top |
|
 |
freke Veteran

Joined: 23 Jan 2003 Posts: 1072 Location: Somewhere in Denmark
|
Posted: Wed Jul 25, 2018 1:28 pm Post subject: |
|
|
orion777 wrote: | Good day! Now I can't force name server to work.. Static or DHCP configuration returns same result (NetworkManager has been removed from rc)
Code: | pi64 ~ # ping google.lv
ping: google.lv: Temporary failure in name resolution
pi64 ~ # cat /etc/conf.d/net
#eth0
#config_eth0="dhcp"
config_eth0="192.168.1.115 netmask 255.255.255.0"
routes_eth0="default via 192.168.1.1"
dns_servers_eth0="8.8.8.8 8.8.4.4"
|
|
Can you ping 8.8.8.8 and 8.8.4.4?
You're sure your interface is named eth0? (what does ifconfig say?) |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55178 Location: 56N 3W
|
Posted: Wed Jul 25, 2018 5:51 pm Post subject: |
|
|
orion777,
One step at a time. What does show _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
orion777 Apprentice

Joined: 15 Mar 2017 Posts: 207 Location: Riga, Latvia
|
Posted: Thu Jul 26, 2018 7:15 pm Post subject: |
|
|
So, I put back NetworkManager into autostart. As can be seen, the ping is able to ping google.lv even after NetworkManager has been stopped, but the system was not rebooted.
Code: | pi64 ~ # ps -ax | grep NetworkManager
1868 ? Ssl 0:00 /usr/sbin/NetworkManager --pid-file /run/NetworkManager/NetworkManager.pid
2053 ? S 0:00 /sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /run/dhclient-eth0.pid -lf /var/lib/NetworkManager/dhclient-67c07402-fa8d-3137-a466-9b22cfcc2fd6-eth0.lease -cf /var/lib/NetworkManager/dhclient-eth0.conf eth0
2896 pts/0 S+ 0:00 grep --colour=auto NetworkManager
pi64 ~ # ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=118 time=24.3 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=118 time=23.6 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 3ms
rtt min/avg/max/mdev = 23.571/23.922/24.273/0.351 ms
pi64 ~ # ping 8.8.4.4
PING 8.8.4.4 (8.8.4.4) 56(84) bytes of data.
64 bytes from 8.8.4.4: icmp_seq=1 ttl=119 time=28.7 ms
64 bytes from 8.8.4.4: icmp_seq=2 ttl=119 time=25.2 ms
^C
--- 8.8.4.4 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 3ms
rtt min/avg/max/mdev = 25.208/26.974/28.741/1.774 ms
pi64 ~ # ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.115 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::4841:5b11:68e6:b2cb prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:28:f1:db txqueuelen 1000 (Ethernet)
RX packets 278 bytes 24526 (23.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 162 bytes 23531 (22.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
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 1000 (Local Loopback)
RX packets 8 bytes 576 (576.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 576 (576.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 22:65:72:89:34:45 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
pi64 ~ # /etc/init.d/NetworkManager stop
* Stopping NetworkManager ... [ ok ]
pi64 ~ # ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.115 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::4841:5b11:68e6:b2cb prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:28:f1:db txqueuelen 1000 (Ethernet)
RX packets 448 bytes 36500 (35.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 254 bytes 36363 (35.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
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 1000 (Local Loopback)
RX packets 8 bytes 576 (576.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 576 (576.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:7d:a4:8e 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
pi64 ~ # ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=118 time=20.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=118 time=21.9 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 3ms
rtt min/avg/max/mdev = 20.423/21.169/21.916/0.760 ms
pi64 ~ # ping google.lv
PING google.lv (216.58.211.3) 56(84) bytes of data.
64 bytes from muc03s13-in-f3.1e100.net (216.58.211.3): icmp_seq=1 ttl=52 time=20.6 ms
64 bytes from muc03s13-in-f3.1e100.net (216.58.211.3): icmp_seq=2 ttl=52 time=20.0 ms
^C
--- google.lv ping statistics ---
3 packets transmitted, 2 received, 33.3333% packet loss, time 5ms
rtt min/avg/max/mdev = 20.003/20.283/20.563/0.280 ms
pi64 ~ # rc-update del NetworkManager default
* service NetworkManager removed from runlevel default
pi64 ~ # reboot
|
Now rebooting without NetworkManager in the autostart. Please note that all settings per https://wiki.gentoo.org/wiki/Handbook:X86/Full/Networking#Using_the_old-style_kernel_naming has been already done and was not removed during previous testing!
Code: | pi64 ~ # ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.115 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::ba27:ebff:fe28:f1db prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:28:f1:db txqueuelen 1000 (Ethernet)
RX packets 67 bytes 6108 (5.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 51 bytes 8947 (8.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
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 1000 (Local Loopback)
RX packets 8 bytes 576 (576.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 576 (576.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:7d:a4:8e 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
pi64 ~ # ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=118 time=25.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=118 time=19.9 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 3ms
rtt min/avg/max/mdev = 19.944/22.689/25.434/2.745 ms
pi64 ~ # ping google.lv
ping: google.lv: Temporary failure in name resolution
pi64 ~ # cd /etc/init.d
pi64 /etc/init.d # ls | grep net.eth0
net.eth0
pi64 /etc/init.d # cat /etc/conf.d/net
#eth0
#config_eth0="dhcp"
config_eth0="192.168.1.115 netmask 255.255.255.0"
routes_eth0="default via 192.168.1.1"
dns_servers_eth0="8.8.8.8 8.8.4.4"
#eth1
#config_eth1="192.168.8.11 netmask 255.255.255.0"
#routes_eth1="default via 192.168.8.1"
#dns_servers_eth1="192.168.8.1 8.8.8.8"
#wlan0
#config_wlan0="dhcp"
pi64 /etc/init.d # /etc/init.d/net.eth0 start
* WARNING: net.eth0 has already been started
pi64 /etc/init.d # rc-update | grep net.eth0
net.eth0 | default
|
|
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55178 Location: 56N 3W
|
Posted: Thu Jul 26, 2018 9:31 pm Post subject: |
|
|
orion777,
Code: | eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.115 netmask 255.255.255.0 broadcast 192.168.1.255 | you have an IP address without Network Manager.
How does that happen?
In this state, what is the output of
What is in /etc/resolv.conf.
You are either missing a route or nameservers ... or both.
Normally, the automatic setup does either everything or nothing. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
orion777 Apprentice

Joined: 15 Mar 2017 Posts: 207 Location: Riga, Latvia
|
Posted: Fri Jul 27, 2018 7:36 am Post subject: |
|
|
NeddySeagoon wrote: | orion777,
Code: | eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.115 netmask 255.255.255.0 broadcast 192.168.1.255 | you have an IP address without Network Manager.
How does that happen? |
This IP has been taken from the /etc/conf.d/net file. However, dhcp also assign 192.168.1.115 . To be able to recognize source of the settings, I put IP 192.168.1.200 into the net file.
Code: | cat /etc/conf.d/net
#eth0
#config_eth0="dhcp"
config_eth0="192.168.1.200 netmask 255.255.255.0"
routes_eth0="default via 192.168.1.1"
dns_servers_eth0="8.8.8.8 8.8.4.4"
#eth1
#config_eth1="192.168.8.11 netmask 255.255.255.0"
#routes_eth1="default via 192.168.8.1"
#dns_servers_eth1="192.168.8.1 8.8.8.8"
#wlan0
#config_wlan0="dhcp" | ]
After reboot I have:
Code: | pi64 ~ # ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.200 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::ba27:ebff:fe28:f1db prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:28:f1:db txqueuelen 1000 (Ethernet)
RX packets 133 bytes 10534 (10.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 80 bytes 12797 (12.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
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 1000 (Local Loopback)
RX packets 32 bytes 2304 (2.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 32 bytes 2304 (2.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
As can be seen, eth0 takes its configuration from the /etc/conf.d/net as eth0 IP becomes 192.168.1.200
Quote: | In this state, what is the output of route? |
HEre is the output:
Code: | pi64 ~ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.1.1 0.0.0.0 UG 2 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
|
Quote: | What is in /etc/resolv.conf ? |
I was not entering any configurations into it as there are nothing about /etc/resolv.conf in the https://wiki.gentoo.org/wiki/Handbook:X86/Full/Networking#Using_the_old-style_kernel_naming
So I have no such file in my system:
Code: | pi64 ~ # cat /etc/resolv.conf
cat: /etc/resolv.conf: No such file or directory
|
--------------------------
Update:
As I plan to run NAT server on this raspberry per https://wiki.gentoo.org/wiki/Ethernet_plus_WiFi_Bridge_Router_and_Firewall the dnsmasq has peen already installed, but it was not configured jet! So, maybe here is the problem cause?
Code: | pi64 /etc/hostapd # eix net-dns/dnsmasq
[I] net-dns/dnsmasq
Available versions: (~)2.78 (~)2.79{tbz2} {auth-dns conntrack dbus +dhcp dhcp-tools dnssec (+)id idn +inotify ipv6 libidn2 lua nls script selinux static tftp}
Installed versions: 2.79{tbz2}(08:15:04 24/07/18)(dbus dhcp inotify ipv6 nls -auth-dns -conntrack -dhcp-tools -dnssec -id -idn -libidn2 -lua -script -selinux -static -tftp)
Homepage: http://www.thekelleys.org.uk/dnsmasq/doc.html
Description: Small forwarding DNS server
pi64 /etc/hostapd # rc-update | grep dnsmasq
pi64 /etc/hostapd # ps -ax | grep dnsmasq
9672 pts/2 S+ 0:00 grep --colour=auto dnsmasq
pi64 /etc/hostapd #
|
|
|
Back to top |
|
 |
krinn Watchman


Joined: 02 May 2003 Posts: 7471
|
Posted: Fri Jul 27, 2018 11:37 am Post subject: |
|
|
you lack loopback in boot runlevel?
you should have localhost route define in route too.
you should define your nameserver in /etc/resolv.conf ; and this only for the reason to see if someone is affecting your name servers definition (if you set them in resolv.conf you will see easy if someone alter its content). |
|
Back to top |
|
 |
orion777 Apprentice

Joined: 15 Mar 2017 Posts: 207 Location: Riga, Latvia
|
|
Back to top |
|
 |
|