index Previous Next



Fist remove the files with aptitude:
aptitude purge network-manager-gnome network-manager network-manager-kde
We want to setup the debian box as router and default gateway with dnsmasq, which is already configured to work as dns and dhcp server and will
assign the dynamic ip addresses for other network interfaces when connected, and the iptables should be configured to ip forward
and masquerade domain.
For this we should first configure the debian network interface (eth0) for the static ip address, open the file
/etc/network/interfaces and edit as:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 208.67.222.123
#dns-search example.net
The line dns-nameservers 208.67.222.123 will update the /var/run/dnsmasq/resolv.conf to nameserver 208.67.222.123
in every network start, which is necessary for the dnasmasq to work.
If the resolvconf packages is not installed and want the /etc/resolv.conf only contain the nameservers 127.0.0.1 add this
line to the end of file:
post-up echo "nameserver 127.0.0.1" > /etc/resolv.conf
Other wise the resolveconf should be configured to edit this file and add the nameserver 127.0.0.1 to /etc/resolv.conf .
Now edit the file /etc/networks as:
default 0.0.0.0
loopback 127.0.0.0
link-local 192.168.1.0
localnet 192.168.1.0
Now tes with the:
ifconfig
and:
netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
175.106.58.11 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ppp0
Continue
