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 previous 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?
 
Read Message
Read Message
Previous Topic: Kernel Test
Next Topic: *SOLVED* Default Gateway
Goto Forum:
  


Current Time: Tue Jul 29 05:58:50 GMT 2025

Total time taken to generate the page: 0.30421 seconds