I have come up against this error a number of times, but haven’t yet found an explanation of what the error means, or what can cause the problem.
I’m not posting my configs or the specific route I’m trying to add as I don’t want someone to tell me what I’ve done wrong THIS time, I’d like an understanding of what the error means (what is RTNETLINK for a start), and what are the common/known causes of this error, so that I can solve it for myself this and next time.
# ip route add .....
RTNETLINK answers: No such process
asked Oct 12, 2012 at 4:27
Rtnetlink allows the kernel’s routing tables to be read and altered. It is used within the kernel to communicate between various subsystems, and for communication with user-space programs. Source
The most common cause for the message I’ve seen is that you’re trying to route via a path that is not known to the host. For example, LAN is 192.168.56.100 and WAN is 10.0.3.15. ip route add 8.8.8.8/32 via 192.168.6.1
results in RTNETLINK answers: No such process
because 192.168.6.1 is not known to the host.
answered Oct 12, 2012 at 5:02
porpor
7406 silver badges8 bronze badges
1
Подключаюсь по openVPN к серверу примерно так:
openvpn --client --dev tun --proto udp --remote xx.xx.xx.xx 1194 --resolv-retry infinite --nobind --persist-key --persist-tun --ca ???.crt --cert ???.crt --key ???.key --ns-cert-type server --tls-auth ???ta.key 1 --comp-lzo --verb 3
Перед этим делаю:
modprobe tun
так как у меня в /dev/net нет tun0 почему-то.
После этого у меня вываливается вот такая ошибка:
ip route add 172.16.1.0/24 via 172.16.4.1
Я присоединяюсь к сети 172.16.4.0/24 и могу по’ping’ать 172.16.4.1, но как маршрутизатор он почему-то не добавляется. Что может быть не так?
RTNETLINK answers: No such process
Вот вывод netstat:
[root@Linux ~]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
255.255.255.0 * 255.255.255.255 UH 0 0 0 tun0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.10.0 * 255.255.255.0 U 0 0 0 vmnet1
172.16.122.0 * 255.255.255.0 U 0 0 0 vmnet8
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
« Последнее редактирование: 03.10.2012 22:29:29 от Skull »
Записан
Логично. Где он, этот 172.16.4.1 ? Этот IP недостижим с данного хоста без маршрутизатора.
Кстати, идеологически верно отвыкать от netstat -r и привыкать к ip r
Записан
Но у меня же появляется новый сетевой интерфейс с 172.16.4.6
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:172.16.4.6 P-t-P:255.255.255.0 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Записан
Просто пока не пойму что нужно сделать.
У меня несколько сетевых интерфейсов: eth0, tun0, vmnet1, vmnet8 и lo.
У каждого из них свой ip.
У моего хоста как бы 4 сетевые карты. Я не пойму почему:
Логично. Где он, этот 172.16.4.1 ? Этот IP недостижим с данного хоста без маршрутизатора.
Записан
Какая-то тут есть засада. Почему P-t-P адрес больше напоминает маску ?
А 172.16.4.6/255.255.255.255 — это хост, а не сеть. 172.16.4.1 сюда никак не попадает.
В общем, с непонятным P-t-P:255.255.255.0, который, очевидно, и должен иметь значение 172.16.4.1, надо разобраться, а, потом, сделать ip route add 172.16.1.0/24 via dev tun0 и забыть про этот 172.16.4.1. Для p-t-p интерфейсов IP-адрес в маршруте не нужен. Это только для броадкастных, а-ля ethernet, надо.
« Последнее редактирование: 02.10.2012 20:12:01 от asy »
Записан
Host 172.16.4.1 достижим:
netstat -r
А вот это не работает:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.10.0 * 255.255.255.0 U 0 0 0 vmnet1
172.16.122.0 * 255.255.255.0 U 0 0 0 vmnet8
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
[root@Linux ~]# ping 172.16.4.1
PING 172.16.4.1 (172.16.4.1) 56(84) bytes of data.
64 bytes from 172.16.4.1: icmp_seq=1 ttl=249 time=18.5 ms
64 bytes from 172.16.4.1: icmp_seq=2 ttl=249 time=16.7 ms
64 bytes from 172.16.4.1: icmp_seq=3 ttl=249 time=19.8 ms
64 bytes from 172.16.4.1: icmp_seq=4 ttl=249 time=19.1 ms
^C
--- 172.16.4.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 16.780/18.576/19.867/1.145 ms
[root@Linux ~]# ip route add 172.16.1.0/24 via 172.16.4.1 dev tun0
Но зато я могу выполнить вот это:
RTNETLINK answers: No such process
[root@Linux ~]#
[root@Linux ~]# ip route add 172.16.1.0/24 via 192.168.0.1 dev eth0
Я просто что-то не пойму. Почему ерундовый маршрут добавляется, а нужный нет.
[root@Linux ~]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
172.16.1.0 192.168.0.1 255.255.255.0 UG 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.10.0 * 255.255.255.0 U 0 0 0 vmnet1
172.16.122.0 * 255.255.255.0 U 0 0 0 vmnet8
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
[root@Linux ~]#
Записан
Получилось!!!
Что-то я не догнал…
Логично. Где он, этот 172.16.4.1 ?
Я его добавил так:
[root@Linux ~]# ip route add 172.16.4.0/24 dev tun0
Потом я сделал вот так:
[root@Linux ~]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
172.16.4.0 * 255.255.255.0 U 0 0 0 tun0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.10.0 * 255.255.255.0 U 0 0 0 vmnet1
172.16.122.0 * 255.255.255.0 U 0 0 0 vmnet8
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
[root@Linux ~]# ip route add 172.16.1.0/24 via 172.16.4.1 dev tun0
И всё заработало!!!
[root@Linux ~]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
172.16.4.0 * 255.255.255.0 U 0 0 0 tun0
172.16.1.0 sw1-sm53.l.kraf 255.255.255.0 UG 0 0 0 tun0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.10.0 * 255.255.255.0 U 0 0 0 vmnet1
172.16.122.0 * 255.255.255.0 U 0 0 0 vmnet8
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
[root@Linux ~]#
Теперь я могу в браузере зайти на какой-нибудь местный сервер с web-интерфейсом, набирая в браузере http://172.16.1.1, например!!!
Записан
Host 172.16.4.1 достижим:
Мало ли, что пингатся. У меня вот www.ru пингается, но это не значит, что я могу маршрут на 194.87.0.50 прописать. traceroute сколько хопов показывает до 172.16.4.1 в той ситуации ?
ip route add 172.16.4.0/24 dev tun0
точно, via я там зря написал.
ip route add 172.16.1.0/24 via 172.16.4.1 dev tun0
А зачем ? Точно так же: ip route add 172.16.1.0/24 dev tun0
Записан
I am currently trying to route all incoming and outgoing network traffic to/from applications listening on an OpenVPN tunnel tun1 through said tunnel.
Here are my devices: tun0
is an OpenVPN server running on the machine that provides access to the machine’s local network to remote machines. tun1
is an OpenVPN client to a remote server.
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1c:c0:d7:98:1c
inet addr:192.168.178.9 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::21c:c0ff:fed7:981c/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:103987444 errors:0 dropped:0 overruns:0 frame:0
TX packets:161412265 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:583178850 (556.1 MiB) TX bytes:1006632339 (959.9 MiB)
Interrupt:43 Base address:0x8000
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:505197 errors:0 dropped:0 overruns:0 frame:0
TX packets:505197 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:91836367 (87.5 MiB) TX bytes:91836367 (87.5 MiB)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.9.8.1 P-t-P:10.9.8.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:272 (272.0 B) TX bytes:960 (960.0 B)
tun1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.10 P-t-P:10.8.0.9 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:588 (588.0 B) TX bytes:588 (588.0 B)
Here are the currently active routes:
# ip route show table main
default via 192.168.178.1 dev eth0
10.8.0.1 via 10.8.0.9 dev tun1
10.8.0.9 dev tun1 proto kernel scope link src 10.8.0.10
10.9.8.0/24 via 10.9.8.2 dev tun0
10.9.8.2 dev tun0 proto kernel scope link src 10.9.8.1
192.168.178.0/24 dev eth0 proto kernel scope link src 192.168.178.9
After some research, I learned that I had to use «policy routing» to direct all traffic on tun1 through another gateway (10.8.0.1). So I created a new table «tun1» and tried to configure it.
# echo "1 tun1tbl" >> /etc/iproute2/rt_tables
# ip route add 10.8.0.0/24 dev tun1 src 10.8.0.10 table tun1tbl
# ip route add default via 10.8.0.1 dev tun1 table tun1tbl
RTNETLINK answers: No such process
Why can’t I set the default route for this device/table?
—
edit: I just found another potential solution, using only route
, but it fails with a similar error:
# route add default gw 10.8.0.1 dev tun1
SIOCADDRT: No such process
I have a PC which has 192.168.1.1/24 configured to eth0 interface. Now if I try to add routes via 10.10.10.254, the ip
utility reports that No such process
:
root@PC:~# ip neigh add 10.10.10.254 lladdr 00:01:02:03:04:05 dev eth0
root@PC:~# ip route add default via 10.10.10.254 dev eth0
RTNETLINK answers: No such process
root@PC:~# ip route add 172.16.0.1/32 via 10.10.10.254 dev eth0
RTNETLINK answers: No such process
root@PC:~#
As long as PC knows the MAC address of 10.10.10.254 it is technically possible to send data via 10.10.10.254 while 10/8 network is not configured to any interface in PC. Based on my example it would use PCs eth0 MAC address as a source MAC, 00:01:02:03:04:05 as a destination MAC, 192.168.1.1 as a source IP address and destination address would be whatever I specify.
Is it possible to force Linux to add a route if sub-net, where gateway is situated, is not in configured to an interface?
- Печать
Страницы: [1] Вниз
Тема: RTNETLINK answers: No such process (Прочитано 4971 раз)
0 Пользователей и 1 Гость просматривают эту тему.
_navi_
содежржимое файла /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.32.230
netmask 255.255.254.0
gateway 192.168.32.222
auto eth1
iface eth1 inet static
address 192.168.55.1
netmask 255.255.255.0
при запуске команды
/etc/init.d/networking restart
выдаеться ошибка
Reconfiguring network interfaces...RTNETLINK answers: No such process
вывод route -n
[OK]
Destination Gateway Genmask Flags MSS Window irtt Iface
при этом все прекрасно работает..инет в сети 192.168.55.0/24 есть
192.168.55.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.32.0 0.0.0.0 255.255.254.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
0.0.0.0 192.168.32.222 0.0.0.0 UG 100 0 0 eth0
В чем может быть проблема?
П.С. avahi-daemon, avahi-autoipd — удалил…
Пользователь решил продолжить мысль 20 Мая 2010, 10:39:10:
подправил файл /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.32.230
netmask 255.255.254.0
gateway 192.168.32.222
iface eth1 inet static
address 192.168.55.1
netmask 255.255.255.0
up ifconfig eth1 up
при перезагрузке не выдает ошибку…это не костыль ли???
« Последнее редактирование: 20 Мая 2010, 12:42:36 от _navi_ »
alecsartania
Дома Linux Mint 20.1 / 20.02
_navi_
выводит инфу по каждому интерфейсу..только если до этого интерфейс eth1 был включен….если же eth1 былк выключен, то он не запускаеться(((((
botsman
выводит инфу по каждому интерфейсу..только если до этого интерфейс eth1 был включен….если же eth1 былк выключен, то он не запускаеться(((((
Он и не запуститься без
auto eth1
- Печать
Страницы: [1] Вверх