Hello,
I am using CentOS 5 with Vmware Server in order to run Windows2k3.
What I am trying to do is associate the windows virtual machine with just one of the many IP addresses that I have setup in CentOS. Bridged networking is not an option so I have to use NAT or Host-Only.
ifconfig -a:
Code:
eth0 Link encap:Ethernet HWaddr 00:E0:4C:4F:5A:D1
inet addr:85.10.192.172 Bcast:85.10.192.191 Mask:255.255.255.224
inet6 addr: fe80::2e0:4cff:fe4f:5ad1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1230673 errors:1 dropped:0 overruns:0 frame:0
TX packets:1459180 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:373669391 (356.3 MiB) TX bytes:972460494 (927.4 MiB)
Interrupt:185 Base address:0x2000
eth0:2 Link encap:Ethernet HWaddr 00:E0:4C:4F:5A:D1
inet addr:88.198.75.114 Bcast:88.198.75.119 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:185 Base address:0x2000
eth0:3 Link encap:Ethernet HWaddr 00:E0:4C:4F:5A:D1
inet addr:88.198.75.115 Bcast:88.198.75.119 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:185 Base address:0x2000
eth0:4 Link encap:Ethernet HWaddr 00:E0:4C:4F:5A:D1
inet addr:88.198.75.116 Bcast:88.198.75.119 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:185 Base address:0x2000
eth0:5 Link encap:Ethernet HWaddr 00:E0:4C:4F:5A:D1
inet addr:88.198.75.118 Bcast:88.198.75.119 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:185 Base address:0x2000
eth0:6 Link encap:Ethernet HWaddr 00:E0:4C:4F:5A:D1
inet addr:88.198.75.117 Bcast:88.198.75.119 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:185 Base address:0x2000
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:333047 errors:0 dropped:0 overruns:0 frame:0
TX packets:333047 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:62068125 (59.1 MiB) TX bytes:62068125 (59.1 MiB)
sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 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)
vmnet0 Link encap:Ethernet HWaddr 00:50:56:C0:00:00
inet addr:192.168.4.1 Bcast:192.168.4.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:248 errors:0 dropped:0 overruns:0 frame:0
TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
And I am trying to do something like this:
Code:
/sbin/iptables -t nat -A PREROUTING -d 88.198.75.117 -j DNAT --to 192.168.4.101
/sbin/iptables -t nat -A POSTROUTING -s 192.168.4.101 -j SNAT --to 88.198.75.117
But even though all my tips suggest it should work, Vmware still uses the default IP of eth0 (85.10.192.172) when connected to the internet when I use NAT. In the other hand when using Host-only networking in Vmware I have no internet at all (even though my host suggest I should) All I need is for the outside world to see that box as 88.198.75.117. Note that I have enabled ip forward in /etc/sysctl.conf and tried both host only and NAT modes.
Any tips would be greatly appreciated as I am just starting with iptables and I am really stuck for a few days now.
Thanks.