[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

please help on adsl sharing



I try to set up adsl sharing on two computer but I have problems.
The situation:

adsl --->A(connected to adsl) ------ B(internal machine)

I do the followings:

on machine A have the followings:
------------------------------------
1) /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0 eth1
iface eth0 inet static
   address 192.168.1.2
   netmask 255.255.255.0
   network 192.168.1.0
   broadcast 192.168.1.255
iface eth1 inet static
   address 192.168.1.1
   netmask 255.255.255.0
   network 192.168.1.0
   broadcast 192.168.1.255

The kernel on A and B(2.4) has the ip-masquerade features which specified in ip-masquerade howto. The dist is debian sid, I use the installed iptables (not compiled from source)

2) Before connecting to adsl I run the following script:
#!/bin/sh
IPTABLES=/sbin/iptables
DEPMOD=/sbin/depmod
INSMOD=/sbin/insmod
EXTIF="eth1"
INTIF="eth0"
$DEPMOD -a
$INSMOD ip_tables
$INSMOD ip_conntrack
$INSMOD ip_conntrack_ftp
$INSMOD ip_conntrack_irc
$INSMOD iptable_nat
$INSMOD ip_nat_ftp
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
$IPTABLES -P INPUT ACCEPT
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD REJECT
$IPTABLES -F FORWARD
$IPTABLES -F -t nat
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
$IPTABLES -A FORWARD -j LOG
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

Then I run ppp_on_boot_dsl manually.


on machine B have the followings:
----------------------------------
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
   address 192.168.1.3
   netmask 255.255.255.0
   network 192.168.1.0
   broadcast 192.168.1.255
   gateway 192.168.1.1

-----------
The followings succed: ping or ssh from A to B, ping or ssh from B to A. ping or http from A to the internet(on the server works the adsl)
But I cant ping from B to A.

While pinging from B to A I see the followings in A (tesing ping www.matav.hu with only ip-s)

Feb 5 13:21:05 server kernel: IN=eth0 OUT=ppp0 SRC=192.168.1.3 DST=195.228.240.160 LEN=84 TOS=0x00 PREC=0x00 TTL=63 ID=50 PROTO=ICMP TYPE=8 CODE=0 ID=64512 SEQ=1280 Feb 5 13:21:06 server kernel: IN=eth0 OUT=ppp0 SRC=192.168.1.3 DST=195.228.240.160 LEN=84 TOS=0x00 PREC=0x00 TTL=63 ID=51 PROTO=ICMP TYPE=8 CODE=0 ID=64512 SEQ=1536 Feb 5 13:21:07 server kernel: IN=eth0 OUT=ppp0 SRC=192.168.1.3 DST=195.228.240.160 LEN=84 TOS=0x00 PREC=0x00 TTL=63 ID=52 PROTO=ICMP TYPE=8 CODE=0 ID=64512 SEQ=1792 Feb 5 13:21:08 server kernel: IN=eth0 OUT=ppp0 SRC=192.168.1.3 DST=195.228.240.160 LEN=84 TOS=0x00 PREC=0x00 TTL=63 ID=53 PROTO=ICMP TYPE=8 CODE=0 ID=64512 SEQ=2048 Feb 5 13:21:09 server kernel: IN=eth0 OUT=ppp0 SRC=192.168.1.3 DST=195.228.240.160 LEN=84 TOS=0x00 PREC=0x00 TTL=63 ID=54 PROTO=ICMP TYPE=8 CODE=0 ID=64512 SEQ=2304 Feb 5 13:21:10 server kernel: IN=eth0 OUT=ppp0 SRC=192.168.1.3 DST=195.228.240.160 LEN=84 TOS=0x00 PREC=0x00 TTL=63 ID=55 PROTO=ICMP TYPE=8 CODE=0 ID=64512 SEQ=2560 Feb 5 13:21:11 server kernel: IN=eth0 OUT=ppp0 SRC=192.168.1.3 DST=195.228.240.160 LEN=84 TOS=0x00 PREC=0x00 TTL=63 ID=56 PROTO=ICMP TYPE=8 CODE=0 ID=64512 SEQ=2816

But I've got no response on B. What may wrong?

Thanks for any help
Attila






Reply to: