OpenVZ Forum


Home » General » Support » RTNETLINK answers: File exists for veth interface
icon9.gif  RTNETLINK answers: File exists for veth interface [message #15008] Mon, 16 July 2007 15:18 Go to next message
danielcamara is currently offline  danielcamara
Messages: 8
Registered: July 2007
Location: France
Junior Member
Ok I am doing something wrong but I don't know what.

My problem is that I need to run a multicast application, and the standard network interface (vnet) doesn't work. When I try to enable the virtual sistem using the veth interface the network doesn't work. I followed the how to from http://wiki.openvz.org/Veth, Sad

Below I will list below all the steps, from the beginning even creating the image, I know it maybe overkill, but I really don't know if I made a mistake there also Sad.

Two steps give me errors that I couldn't find any valuable reference on the Internet. The first one, that I think it is not the problem is when I try to say that the default device is the eth0 inside the virtual system.

virtual 104 #> /sbin/ip route add default dev eth0
RTNETLINK answers: File exists

However, this error i think it is fine, because I use the route command to change the table. I still can't figure out what it means, but I think it is not the problem.

The problem I think it is when I attach the virtual interface to its IP at the server
host #> ip route add 192.168.12.104 dev veth104.0
RTNETLINK answers: No such device

I tried to find about this message on the Internet, but the references I found were not that useful Sad, and after some one ask, yes the interface exists.


host #> ifconfig
eth0 Link encap:Ethernet HWaddr 00:0A:5E:52:B4:C8
inet addr:192.168.12.41 Bcast:192.168.12.255 Mask:255.255.255.0
inet6 addr: 2001:660:5502:12:20a:5eff:fe52:b4c8/64 Scope:Global
inet6 addr: fe80::20a:5eff:fe52:b4c8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6275718 errors:0 dropped:0 overruns:2 frame:0
TX packets:12603 errors:0 dropped:0 overruns:0 carrier:0
collisions:1062 txqueuelen:1000
RX bytes:620831686 (592.0 MiB) TX bytes:1931914 (1.8 MiB)
Interrupt:5

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:383 errors:0 dropped:0 overruns:0 frame:0
TX packets:383 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:19580 (19.1 KiB) TX bytes:19580 (19.1 KiB)

venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:11 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:637 (637.0 b) TX bytes:1282 (1.2 KiB)

veth104.0 Link encap:Ethernet HWaddr 00:12:34:56:71:04
inet6 addr: fe80::212:34ff:fe56:7104/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:72 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2448 (2.3 KiB) TX bytes:0 (0.0 b)

When inside the virtual machine I ping other machine, I can't see anything. However, some messages appear at the virtual interface at the real machine because I can see something with the tcpdump


# even if I ping the default gateway
virtual 104 #> ping 192.168.12.100
PING 192.168.12.100 (192.168.12.100) 56(84) bytes of data.
From 192.168.12.104 icmp_seq=2 Destination Host Unreachable
From 192.168.12.104 icmp_seq=3 Destination Host Unreachable
From 192.168.12.104 icmp_seq=4 Destination Host Unreachable

--- 192.168.12.100 ping statistics ---
6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4998ms
, pipe 3

# looking at the tcpdump output
# carne is the name of 192.168.12.100 machine
host #> tcpdump -v -i veth104.0
tcpdump: WARNING: veth104.0: no IPv4 address assigned
tcpdump: listening on veth104.0, link-type EN10MB (Ethernet), capture size 96 bytes
16:32:08.758121 arp who-has carne tell 192.168.12.104
16:32:09.757874 arp who-has carne tell 192.168.12.104
16:32:10.757664 arp who-has carne tell 192.168.12.104
16:32:13.758023 arp who-has carne tell 192.168.12.104
16:32:14.757816 arp who-has carne tell 192.168.12.104
16:32:15.757605 arp who-has carne tell 192.168.12.104


Below I am reproducing the WHOLE process I am doing. Please if any one have any idea... I am opened to suggestions Smile.

Best regards...

Daniel Camara

-----------------------------------
The whole process step by step
-----------------------------------

# Load module
host #> modprobe vzethdev

# To create based on a template
host #> vzctl create 104 --ostemplate debian-4.0-i386-minimal

# To verify if it was created
host #> vzlist -a
VEID NPROC STATUS IP_ADDR HOSTNAME
104 - stopped - -

# Configuring network
host #> vzctl set 104 --ipadd 192.168.12.104 --save
Saved parameters for VE 104
host #> rvzctl set 104 --nameserver 192.168.12.100 --save
Saved parameters for VE 104

host #> vzctl set 104 --netif_add eth0,00:12:34:56:74:01,veth104.0,00:12:34:56:71:04 --save
Saved parameters for VE 104

host #> vzctl start 104
Starting VE ...
VE is mounted
Adding IP address(es): 192.168.12.104
Setting CPU units: 1000
File resolv.conf was modified
Configure veth devices: veth104.0
VE start in progress...

host #> ifconfig veth104.0 0
host #> echo 1 > /proc/sys/net/ipv4/conf/veth104.0/forwarding
host #> echo 1 > /proc/sys/net/ipv4/conf/veth104.0/proxy_arp
host #> echo 1 > /proc/sys/net/ipv4/conf/eth0/forwarding
host #> echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp

host #> vzctl enter 104

virtual 104 #> ifconfig
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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP 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:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

virtual 104 #> /sbin/ifconfig eth0 0
virtual 104 #> /sbin/ip addr add 192.168.12.104 dev eth0

## HERE the first error occour!!! I have no Idea, I tried to find about
## but none of the answeres I found fit in my case
virtual 104 #> /sbin/ip route add default dev eth0
RTNETLINK answers: File exists

virtual 104 #> ifconfig
eth0 Link encap:Ethernet HWaddr 00:12:34:56:74:01
inet addr:192.168.12.104 Bcast:0.0.0.0 Mask:255.255.255.255
inet6 addr: fe80::212:34ff:fe56:7401/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:384 (384.0 b)

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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP 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:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

# on the host than gives me the second error
host #> ip route add 192.168.12.104 dev veth104.0
RTNETLINK answers: No such device

virtual 104 #> route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.0.2.1 * 255.255.255.255 UH 0 0 0 venet0
default 192.0.2.1 0.0.0.0 UG 0 0 0 venet0

# Changing the route configuration, it is not in the how to, but it is needed
virtual 104 #> route del default gw 192.0.2.1
virtual 104 #> route del -host 192.0.2.1
virtual 104 #> route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.12.0 * 255.255.255.0 U 0 0 0 eth0
default 192.168.12.100 0.0.0.0 UG 0 0 0 eth0


virtual 104 #> ping 192.168.12.100
PING 192.168.12.100 (192.168.12.100) 56(84) bytes of data.
From 192.168.12.104 icmp_seq=2 Destination Host Unreachable
From 192.168.12.104 icmp_seq=3 Destination Host Unreachable
From 192.168.12.104 icmp_seq=4 Destination Host Unreachable

--- 192.168.12.100 ping statistics ---
6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4998ms
, pipe 3

# looking at the tcpdump output
# carne is the name of 192.168.12.100 machine
host #> tcpdump -v -i veth104.0
tcpdump: WARNING: veth104.0: no IPv4 address assigned
tcpdump: listening on veth104.0, link-type EN10MB (Ethernet), capture size 96 bytes
16:32:08.758121 arp who-has carne t
...

Re: RTNETLINK answers: File exists for veth interface [message #15009 is a reply to message #15008] Mon, 16 July 2007 16:54 Go to previous messageGo to next message
danielcamara is currently offline  danielcamara
Messages: 8
Registered: July 2007
Location: France
Junior Member
Well Nevermind, it worked, and believe you or not, the problem was using the ip command. DON'T do these steps:
virtual 104 #> /sbin/ip addr add 192.168.12.104 dev eth0
virtual 104 #> /sbin/ip route add default dev eth0

Instead of that use simply :
virtual 104 #> ifconfig eth0 192.168.12.104
virtual 104 #> route add default gw 192.168.12.100
and remove any thing not needed from the routing table, in my case
virtual 104 #> route del default gw 192.0.2.1

That is it!!! Smile

Regards....

Daniel Camara
Re: RTNETLINK answers: File exists for veth interface [message #15771 is a reply to message #15009] Sat, 11 August 2007 12:31 Go to previous messageGo to next message
jbond007 is currently offline  jbond007
Messages: 78
Registered: January 2006
Location: Miami
Member
have this error
RTNETLINK answers: File exis
when i use tc
how fix this isue
Re: RTNETLINK answers: File exists for veth interface [message #15799 is a reply to message #15771] Mon, 13 August 2007 21:29 Go to previous messageGo to next message
danielcamara is currently offline  danielcamara
Messages: 8
Registered: July 2007
Location: France
Junior Member
Sorry, but what means "tc"?

I put a guide and the scripts I am using here at:
http://www.eurecom.fr/~camara/virtualization/OpenVz.html

I hope it helps Smile

Best regards...

Daniel Camara
Re: RTNETLINK answers: File exists for veth interface [message #35180 is a reply to message #15799] Sat, 07 March 2009 01:49 Go to previous message
bbhenry is currently offline  bbhenry
Messages: 17
Registered: February 2009
Junior Member
danielcamara:

thank you so much for sharing this information. If not for you, I wouldn't be able to get the veth thing working. Does this mean that the wiki is wrong? We should just change the information in the wiki.

Did you make your solution persistent? meaning the config stays the same even after hardware node reboot.

And I am very interest in how you find the correct answer on this one?
Previous Topic: openSUSE 11 template - please test
Next Topic: Measuring CPU usage
Goto Forum:
  


Current Time: Sun Sep 15 10:32:28 GMT 2024

Total time taken to generate the page: 0.03519 seconds