(E-Mail Removed) (aldo maggi) wrote in message news:<(E-Mail Removed). com>...
> i use debian sarge, kernel 2.6.7
> last january i set up my home lan looking as follows:
> class C all ip addresses are 192.168.x.x
> GW=gateway/router DT=desktop
>
> |---------|
> |DSL MODEM|
> |---------|
> |
> |
> ppp0
> |---------| |------|
> | GW |0.1 --- 0.2| DT1 |
> |---------| |------|
> 1.1
> |
> |
> 1.3
> |--------|
> | DT2 |
> |--------|
>
> by no means i am a network guru, therefore i set up my lan mainly googling
> and with some help from friends and this newsgroup, everything works fine
> though i think i could have done all without the need of two subnet (0.0 and
> 1.0)
This is more flexible and secure (IMO) than using GW as a switch --
your only other alternative. The 0.0 net can be easily turned into a
dmz ;-)
> for future searchers: DT1 and DT2 go to internet via the following
> iptables rule
> iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
>
> recently i became fed with unplugging DT2 and plugging my notebook anytime
> i needed to update the software of the latter, therefore i added a eth card
> to DT2 and started trying to connect the NB to internet, i ended up with the
> easiest among solutions..... i made a new subnet 192.168.2.0
> graphically it looks as follows:
>
> |
> |
> 1.3
> |--------| |-------|
> | DT2 |2.1----2.15| NB |
> |--------| |-------|
>
> adding to iptables in DT2 a similar rule to the one above, NB now can go to
> internet.... but (there is always a but, isn't it?) i cannot do ssh nor ping
> from the GW to the NB, almost certainly i need a further iptables rule but my
> very low knowledge of networking doesn't help.
>
> Any suggestions would be appreciated.
>
> aldo
This is not an iptables thingy -- it's a routing thingy. Your GW box
doesn't know how to reach the 2.0 network -- ie., it's routing table
needs an entry telling it which interface to use to reach the 2.0
subnet.
On GW
[root]# route add -net 192.168.2.0 netmask 255.255.255.0 gw dev ethx
(ethx=whichever one is connected to DT2) -- ie., to reach the
192.168.2.0 net send packets out ethx
On DT2
[root]# route add -net 192.168.2.0 netmask 255.255.255.0 dev ethx
(ethx=whichever one is connected to NB) -- ie., to send packets
addressed to the 192.168.2.0 net use ethx
I'm guessing here a bit as to your current routing table entries and
your _exact_ iptables rules, but think this is what you need.
Assuming you can already ping to/from GW-DT1-DT2.
The question is, do you really want/need this? NATing is providing
access to the outside world that originates from NB and access from/to
DT2 is easy enough, but do you really _expect_ the GW machine to
originate packets (like ping or ssh sessions) heading for NB? How
about DT1? Your current lack of connectivity provides a layer
(perhaps small) of security. Just a thought.
If above and "$ man route" and
http://www.tldp.org/HOWTO/Net-HOWTO/x552.html are not enough to get
you going, then post your routing tables from all the machines you
want to "connect":
$ /sbin/route -n
or this one
$ netstat -rn
Probably handy to have output from
$ ifconfig -a
from each machine also to save a question/answer round.
You can X.X.56.34 any public IPs that might show up.
hth,
prg
email above disabled