Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to share internet connection between two host using ethernet device and using pointopoint method but havent yet get any proper response,
Here is the chronology:

setting ip :

host a

ifconfig eth0 10.0.1.1 pointopoint 10.0.1.2 netmask 255.255.255.255

host b

ifconfig eth0 10.0.1.2 pointopoint 10.0.1.1 netmask 255.255.255.255

setting router(host A):

from host a, which host a had set ip_forward to '1' (sysctl and /proc/net/ipv4/)

iptables -A PREROUTING -t nat -j MASQUERADE

and on host b I've done on cli

route add default dev eth0

with /etc/resolv.conf contain

nameserver 8.8.8.8

when pinging google the response like this :

PING google.com (209.85.231.104) 56(84) bytes of data.
From 10.0.1.2 icmp_seq=2 Destination Host Unreachable
From 10.0.1.2 icmp_seq=3 Destination Host Unreachable

oh my? where is my exactly fault ?

thanks in advance guys :)

share|improve this question
    
When you ping Google which host are you pinging from? On host A, what interface is your internet connection on? –  bahamat Jan 30 '11 at 19:14
    
the internet connection interface is ppp0.. and 'route add default gw 10.0.1.2' havent yet make this issue solves... any idea ? –  capede Jan 30 '11 at 19:54
    
ah im pinging google.com from host B(10.0.1.2) –  capede Jan 30 '11 at 20:14
    
Can you ping google from host A? Can host A and host B ping each other? Also, make sure you do not configure your interfaces in pointopoint mode. –  bahamat Jan 31 '11 at 4:27
add comment

1 Answer

First, don't use pointopoint.

Secondly, your route on Host B should be:

route add default gw 10.0.1.2

You want to set your iptables rule to the following:

iptables -A PREROUTING -t nat -i eth0 -o ppp0 -j MASQUERADE

If you can provide more information I'll expand this answer to help you better.

share|improve this answer
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.