You are not logged in.

#1 2012-09-15 03:33:58

robot2051
Member
Registered: 2012-09-15
Posts: 2

Arch in VMware - ip_forward between Bridge and NAT interface

Hi everyone,
I am just setting up a lab for self practice and ran into this problem yesterday and I thought someone here may be able to answer.
Here is my setup:

[Home network] ----192.168.1.144----<vmware bridge interface>   ip_forward   <vmware NAT interface> ----192.168.150.254----[VMWare NAT network]

To put it simply, I want to replace my arch machine as a gateway for my NAT network instead of VMware NAT. This way i could practice with iptable.
At the moment I could not get ip_forward to work even after:

root ~ #  echo 1 > /proc/sys/net/ipv4/ip_forward
root ~ #  cat /proc/sys/net/ipv4/ip_forward
1

My iptables at the moment set to forward ALL traffic:

root ~ #  iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

also on other boxes inside my NAT network, I have configured it with static ip addresses. ping 192.168.150.254 without a problem and i added the default gw:

route add default gw 192.168.150.254

when i did a traceroute, it does go to 192.168.150.254 but it seems the packets got drop there. sad

I'm just wondering if anyone ran into similar problem before and have any solution as I've scratched my head and searched for an hours for solution sad

Actually, Do i need network bridge? hmm will have a look into it now.

Thank you for reading my post and helping. smile
Peace.

Last edited by robot2051 (2012-09-15 04:07:42)

Offline

#2 2012-09-15 04:20:29

robot2051
Member
Registered: 2012-09-15
Posts: 2

Re: Arch in VMware - ip_forward between Bridge and NAT interface

Nvm, i'm an idiot. Problem is solved.

I did a TCP dump and had a look whether the traffic was forwarded out, it was indeed:

root ~ #  tcpdump  -i eth1 -vvv -X 'tcp port 80'
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
00:15:34.289073 IP (tos 0x0, ttl 63, id 29744, offset 0, flags [DF], proto TCP (6), length 60)
    192.168.150.130.54621 > netgear.http: Flags , cksum 0x017b (correct), seq 2446917493, win 14600, options [mss 1460,sackOK,TS val 40471365 ecr 0,nop,wscale 5], length 0
        0x0000:  4500 003c 7430 4000 3f06 aeb7 c0a8 9682  E..<t0@.?.......
        0x0010:  c0a8 0101 d55d 0050 91d8 ff75 0000 0000  .....].P...u....
        0x0020:  a002 3908 017b 0000 0204 05b4 0402 080a  ..9..{..........
        0x0030:  0269 8b45 0000 0000 0103 0305            .i.E........
00:15:35.292937 IP (tos 0x0, ttl 63, id 29745, offset 0, flags [DF], proto TCP (6), length 60)
    192.168.150.130.54621 > netgear.http: Flags , cksum 0x004d (correct), seq 2446917493, win 14600, options [mss 1460,sackOK,TS val 40471667 ecr 0,nop,wscale 5], length 0
        0x0000:  4500 003c 7431 4000 3f06 aeb6 c0a8 9682  E..<t1@.?.......
        0x0010:  c0a8 0101 d55d 0050 91d8 ff75 0000 0000  .....].P...u....
        0x0020:  a002 3908 004d 0000 0204 05b4 0402 080a  ..9..M..........
        0x0030:  0269 8c73 0000 0000 0103 0305            .i.s........
this is from the Bridge interface, I realised the ip address stayed as internal address so to fix it up I "MASQUERADE" ed it:
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

It all works now.
Yay? smile Sorry for the silly question.

Offline

Board footer

Powered by FluxBB