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

Re: simple router



Alexander wrote:
I want create my debian home router:
|"dslmodem" wan ppp0|<-->|eth0<-->(eth1,eth2 - shaping router)|<---|"lan" comp1,comp2|

I've created some configurations: ------------------------------------------------------------------------ 1. /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface #allow-hotplug eth0 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 # dns-nameservers 192.168.1.1 #allow-hotplug eth1 auto eth1 iface eth1 inet static up /sbin/wondershaper eth1 320 320 down /sbin/wondershaper remove eth1 address 192.168.1.4 netmask 255.255.255.0 # network 192.168.1.0 # broadcast 192.168.1.255 #allow-hotplug eth2 auto eth2 iface eth2 inet static up /sbin/wondershaper eth2 320 320 down /sbin/wondershaper remove eth2 address 192.168.1.5 netmask 255.255.255.0 # network 192.168.1.0 # broadcast 192.168.1.255 ------------------------------------------------------------------------ 2. /etc/init.d/iptables.sh # !/bin/sh iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE ------------------------------------------------------------------------ 3. /etc/sysctl.conf net.ipv4.conf.default.forwarding=1 ------------------------------------------------------------------------
But it's not working yet, maybe somebody know why and can help me.


First, try a simple example:
eth0 - ur interface attached to ur dsl modem
address 10.0.0.1
netmask 255.0.0.0.0
network 10.0.0.0
broadcast 10.255.255.255

eth1 - ur lan interface
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

start ur dsl connection
# pon dsl-provider (or whatever name u ve choosen)

masquerade packets
# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

verify ur dsl connection is started
# ifconfig ppp0       |
# ip a s dev ppp0   | it s the same

configure a lan computer
address 192.168.1.2
netmask 255.0.0.0.0
network 10.0.0.0
broadcast 10.255.255.255
gateway 192.168.1.1

try to ping something on the internet
$ ping 209.85.195.99
(this is a google host)

....




Reply to: