Discussion:
router - iptables for WAN 192.168.19. and LAN 192.168.0.
bit
2005-03-18 10:07:44 UTC
Permalink
hi, list
currently I'm configuring router for my lan network
http://www.gentoo.org/doc/en/home-router-howto.xml gave me ideas to
realize it
thanks ***@gentoo.org for that doc

but there is one thing confusing me seriously:
my ISP gave me ip address 192.168.19.101 (yes, that's correct) as gateway
and my LAN is 192.168.0.0/8

I ask you for a piece of advice about what should I change in Code
Listing 5.3 at http://www.gentoo.org/doc/en/home-router-howto.xml
to get working router and LAN especially about rules for NAT

thanks in advance
--
gentoo-***@gentoo.org mailing list
A. Khattri
2005-03-18 13:40:51 UTC
Permalink
Post by bit
my ISP gave me ip address 192.168.19.101 (yes, that's correct) as gateway
and my LAN is 192.168.0.0/8
I doubt your ISP "gave" you that IP (unless this is someone reselling net
access in a building?) - more likely the cable/DSL modem
they gave you is doing NAT already. Ask them what the WAN IP is.

I would also recommend not adding another router and doing double NAT -
strange problems happen with double NAT.
--
Aj. (who works for an ISP :-)

--
gentoo-***@gentoo.org mailing list
Hans-Werner Hilse
2005-03-18 16:06:22 UTC
Permalink
Hi,

On Fri, 18 Mar 2005 13:07:44 +0300
Post by bit
my ISP gave me ip address 192.168.19.101 (yes, that's correct) as gateway
and my LAN is 192.168.0.0/8
That won't work. Your LAN should be 192.168.0.0/24. Otherwise
192.168.19.101 would be routed to the LAN. Remember to count the bits
from the left part to the right. BTW: 192.168.0.0/8 is no valid private
IP range. Netmask must be at least 255.255.0.0 there.
Post by bit
I ask you for a piece of advice about what should I change in Code
Listing 5.3 at http://www.gentoo.org/doc/en/home-router-howto.xml
to get working router and LAN especially about rules for NAT
Oooh, I'm not going to read that now. But routing should be simple:

echo 1 >/proc/sys/net/ipv4/ip_forwarding
iptables -t nat -A POSTROUTING -o wan0 -j MASQUERADE
iptables -A FORWARD -i lan0 -o wan0 -m state --state NEW,ESTABLISHED,RELATED
iptables -A FORWARD -i wan0 -o lan0 -m state --state ESTABLISHED,RELATED

For this to work, wan0 and lan0 are to be replaced by the corresponding interfaces and they need to be up and running.


HWH
--
gentoo-***@gentoo.org mailing list

Continue reading on narkive:
Loading...