Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I added the Virtual LAN eth0:3 in /etc/network/interfaces

ifconfig

eth0      Link encap:Ethernet Hwaddr:00:1e:ec:11:97:dc  
          inet address:10.16.31.179  broadcast:10.16.31.255  netmask:255.255.255.0

eth0:3    Link encap:Ethernet Hwaddr:00:1e:ec:11:97:dc  
          inet address:192.168.55.1  broadcast:192.168.55.255  netmask:255.255.255.0

The rules in iptables :

filter:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  192.168.55.0/24      anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  192.168.55.0/24      anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  

rules in nat table to connect to eth0:

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  all  --  192.168.55.0/24      anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination   

ip route show

192.168.55.0/24 dev eth0  proto kernel  scope link  src 192.168.55.1 
192.168.56.0/24 dev vboxnet0  proto kernel  scope link  src 192.168.56.102 
10.16.31.0/24 dev eth0  proto kernel  scope link  src 10.16.31.179 
default via 10.16.31.1 dev eth0 
default via 10.16.31.1 dev eth0  metric 100 

But why the client with address '192.168.55.111' can ping my computer(sometimes lost a little packets),but I can't ping the '192.168.55.111'?(the client firewall had been closed).

Hope for any answer.

Thanks!

share|improve this question
    
Can you post the output of ip route show? –  Lekensteyn Apr 11 '11 at 12:43
    
@Lekensteyn the result of ip route showhas been added. –  kit.yang Apr 11 '11 at 13:53
add comment

1 Answer 1

It looks like a routing issue. The other side can reach you because their routing scheme seems to be correct. Your side would send everything over eth0.

Try adding a route for the range 192.168.55.0/24 with the gateway address 192.168.55.1 on device eth0:3:

sudo ip route add 192.168.55.0/24 via 192.168.55.1 dev eth0:3
share|improve this answer
    
It shows RTNETLINK answers: File exists. –  kit.yang Apr 12 '11 at 1:19
    
@kit.yang: Can you run sudo ip route del 192.168.55.0/24 dev eth0 before? –  Lekensteyn Apr 12 '11 at 16:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.