the CT's out ip is the host's ip how to config to show it's own

jdkcn

New Member
Jun 23, 2010
2
0
1
jdkcn.com
The host ip is:118.126.5.67
and have a openvz vm has public ip :118.126.5.68 as mail server

but when the vm request internet the got ip 118.126.5.67 not it's own 118.126.5.68

I tried both venet and veth.

the host config:

Code:
auto lo
iface lo inet loopback

iface eth0 inet manual

iface eth1 inet manual

iface eth2 inet manual

iface eth3 inet manual

auto vmbr0
iface vmbr0 inet static
        address  118.126.5.67
        netmask  255.255.255.0
        gateway  118.126.5.1
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0

auto vmbr1
iface vmbr1 inet static
        address  192.168.210.1
        netmask  255.255.255.0
        gateway  192.168.210.1
        bridge_ports eth1
        bridge_stp off
        bridge_fd 0
Code:
server2010:~# ifconfig
eth0      Link encap:Ethernet  HWaddr a4:ba:db:13:d7:90  
          inet6 addr: fe80::a6ba:dbff:fe13:d790/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:66677878 errors:0 dropped:0 overruns:0 frame:0
          TX packets:66392357 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:12081152963 (11.2 GiB)  TX bytes:63086545686 (58.7 GiB)
          Interrupt:36 Memory:d6000000-d6012800 

eth1      Link encap:Ethernet  HWaddr a4:ba:db:13:d7:92  
          UP BROADCAST 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:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:48 Memory:d8000000-d8012800 

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:1636102 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1636102 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:625912867 (596.9 MiB)  TX bytes:625912867 (596.9 MiB)

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:27463367 errors:0 dropped:0 overruns:0 frame:0
          TX packets:23860110 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:22697355661 (21.1 GiB)  TX bytes:6453034731 (6.0 GiB)

veth222.0 Link encap:Ethernet  HWaddr 00:18:51:ab:53:5e  
          inet6 addr: fe80::218:51ff:feab:535e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:51546 errors:0 dropped:0 overruns:0 frame:0
          TX packets:60413 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:73050923 (69.6 MiB)  TX bytes:3262589 (3.1 MiB)

vmbr0     Link encap:Ethernet  HWaddr a4:ba:db:13:d7:90  
          inet addr:118.126.5.67  Bcast:118.126.5.255  Mask:255.255.255.0
          inet6 addr: fe80::a6ba:dbff:fe13:d790/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:46934137 errors:0 dropped:0 overruns:0 frame:0
          TX packets:66402389 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:7799132343 (7.2 GiB)  TX bytes:62841070349 (58.5 GiB)

vmbr1     Link encap:Ethernet  HWaddr a4:ba:db:13:d7:92  
          inet addr:192.168.210.1  Bcast:192.168.210.255  Mask:255.255.255.0
          inet6 addr: fe80::a6ba:dbff:fe13:d792/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:195375 errors:0 dropped:0 overruns:0 frame:0
          TX packets:230651 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:37044025 (35.3 MiB)  TX bytes:254812542 (243.0 MiB)

vmtab103i0 Link encap:Ethernet  HWaddr 00:ff:5b:d5:2a:21  
          inet6 addr: fe80::2ff:5bff:fed5:2a21/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:5764293 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10564193 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:1267327367 (1.1 GiB)  TX bytes:1338231974 (1.2 GiB)

vmtab110i1 Link encap:Ethernet  HWaddr 00:ff:11:cf:01:ab  
          inet6 addr: fe80::2ff:11ff:fecf:1ab/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:195375 errors:0 dropped:0 overruns:0 frame:0
          TX packets:234375 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:40128898 (38.2 MiB)  TX bytes:255208850 (243.3 MiB)

vmtab111i0 Link encap:Ethernet  HWaddr 00:ff:22:47:04:42  
          inet6 addr: fe80::2ff:22ff:fe47:442/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:5152658 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12866850 errors:0 dropped:0 overruns:814626 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:426183295 (406.4 MiB)  TX bytes:1322803957 (1.2 GiB)

The CT's config
Code:
auto eth0
iface eth0 inet static
        address 118.126.5.68
        netmask 255.255.255.0
        gateway 118.126.5.1

when I send mail from 118.126.5.68 I got IP:118.126.5.67