OpenVZ Forum


Home » General » Support » Using real eth device in VE
Using real eth device in VE [message #7217] Sat, 07 October 2006 13:04 Go to next message
enpx is currently offline  enpx
Messages: 50
Registered: October 2006
Member
Hi,

I need to use this eth device in VE:

[root@m0 ~]# ip a show dev eth2
10: eth2: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
     link/ether 00:13:46:e7:d2:1d brd ff:ff:ff:ff:ff:ff
     inet6 fe80::213:46ff:fee7:d21d/64 scope link
        valid_lft forever preferred_lft forever


First of all I check it:

[root@m0 ~]# ip addr add 192.168.15.111/24 dev eth2
[root@m0 ~]# ip route add 192.168.15.11 dev eth2
[root@m0 ~]# ping -c 1 192.168.15.11
PING 192.168.15.11 (192.168.15.11) 56(84) bytes of data.
64 bytes from 192.168.15.11: icmp_seq=1 ttl=64 time=2.88 ms

--- 192.168.15.11 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.889/2.889/2.889/0.000 ms


Next I remove all configuration info from it:

[root@m0 ~]# ip route del 192.168.15.11 dev eth2
[root@m0 ~]# ip addr del 192.168.15.111/24 dev eth2


Create veth device:

# vzctl set 101 --veth_add 
veth0,00:13:46:e7:d2:1d,eth0,00:12:34:56:78:9A --save
Processing veth devices
Saved parameters for VE 101


Configure veth and local eth devices:

[root@m0 ~]# ifconfig eth2 0
[root@m0 ~]# ifconfig veth0 0
[root@m0 ~]# echo 1 > /proc/sys/net/ipv4/conf/eth2/proxy_arp
[root@m0 ~]# echo 1 > /proc/sys/net/ipv4/conf/veth0/proxy_arp
[root@m0 ~]# echo 1 > /proc/sys/net/ipv4/conf/eth2/forwarding
[root@m0 ~]# echo 1 > /proc/sys/net/ipv4/conf/veth0/forwarding


Configure VE eth device:

[root@m0 ~]# vzctl enter 101
entered into VE 101
[root@localhost /]# ip addr show dev eth0
13: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop
     link/ether 00:12:34:56:78:9a brd ff:ff:ff:ff:ff:ff
[root@localhost /]# ip link set eth0 up
[root@localhost /]# ip addr add 192.168.15.111/32 dev eth0
[root@localhost /]# ip route add 192.168.15.11 dev eth0


But it can't work:

[root@localhost /]# ping 192.168.15.11
PING 192.168.15.11 (192.168.15.11) 56(84) bytes of data.

--- 192.168.15.11 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms


What's wrong in my configuration?
Re: Using real eth device in VE [message #7248 is a reply to message #7217] Mon, 09 October 2006 06:17 Go to previous message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello,

do I understand you right, that you want to use physicall device eth2 in a certain VE? If so, do the following:
vzctl set <VEID> --netdev_add eth2

After that you'll be able to work with this device from inside of VE, as usual, i.e. ifconfig, ip commands, etc.

HTH,
vass.
Previous Topic: Kernel Test
Next Topic: *SOLVED* Default Gateway
Goto Forum:
  


Current Time: Sun Jul 27 19:18:52 GMT 2025

Total time taken to generate the page: 0.40131 seconds