Bug in avahi? was: Notebook as Internet client as well as router (for the other computers)
iptables -t nat -o eth0 -A POSTROUTING -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
These lines seem to work fine, the problem is something else.
At present time - through avahi - the local address of the server
(notebook) is 169.254.195.183 on eth2 and ot the other computer (client)
169.254.10.246
When running - on the client - iceweasel (firefox)
http://91.198.174.2
that is the german wikipedia,
and then on the client a ping -c3 on that address
sniffit -a -b -P ICMP,TCP -t 91.198.174.2 -F eth2 (on the server) shows:
eurobook-debian:/home/david# sniffit -a -b -P ICMP,TCP -t 91.198.174.2
-F eth2
Forcing device to eth2 (user requested)...
Make sure you have read the docs carefully.
Supported Network device found. (eth2)
Sniffit.0.3.7 Beta is up and running.... (91.198.174.2)
Packet ID (from_IP.port-to_IP.port): 0.0.0.0.43280-91.198.174.2.80
E . . < . & @ . @ . . . . . . . [ . . . . . . P . . A . . . . . . . . . . .
. . . . . . . . . . . . C . . . . . . . . .
Packet ID (from_IP.port-to_IP.port): 0.0.0.0.43280-91.198.174.2.80
E . . < . ' @ . @ . . . . . . . [ . . . . . . P . . A . . . . . . . . . . .
. . . . . . . . . . . . F . . . . . . . . .
Packet ID (from_IP.port-to_IP.port): 0.0.0.0.43280-91.198.174.2.80
E . . < . ( @ . @ . . . . . . . [ . . . . . . P . . A . . . . . . . . . . .
. . . . . . . . . . . . L . . . . . . . . .
ICMP message id: 0.0.0.0 > 91.198.174.2
ICMP type: Echo
ICMP message id: 0.0.0.0 > 91.198.174.2
ICMP type: Echo
ICMP message id: 0.0.0.0 > 91.198.174.2
ICMP type: Echo
When running the sniffer on the client (without the -F option because it
has only one network adapter, eth0), there is the same result.
Before running the iceweasel and the ping on the client, I entered
route add default gw 169.254.195.183
_Conclusion:_ The client sends every package, that is not for the LAN,
with the source address 0.0.0.0 - so I believe it's a bug, maybe in the
kernel or in package avahi-daemon or avahi-autoipd. So I want to set up
a - local - DHCP server on the laptop, instead of using avahi.
David
Jordi Ferrando Fabra schrieb:
Sorry for the complex script.
If you have eth0 connected to the internet these two lines add DNAT to
the LAN
iptables -t nat -o eth0 -A POSTROUTING -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
On the LAN, I don't see what address you are using.
Assuming LAN is eth1 and the "server" has address 192.168.1.1 with
network mask 255.255.255.0
The others computer on the LAN should have addressing as:
Reply to: