Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Here's my current /etc/network/interfaces file on the "server":

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
    name Wired Network

auto ath0
iface ath0 inet static
    name Wireless Network
    address 10.1.1.1
    netmask 255.255.255.0
    broadcast 10.1.1.255
    wireless-channel 1
    wireless-essid MYNETWORKNAME
    madwifi-base wifi0
    madwifi-mode Master

eth0 (wired connection) works fine on the server, I can ping google.com for example. /etc/resolv.conf has the correct nameservers.

ath0 (wireless connection) also works fine, clients can connect to the server via ssh, for example: root@10.1.1.1

Currently clients are configured:

  • Connect to ESSID: MYNETWORKNAME

  • Static IP: 10.1.1.[2-254]

  • Subnet: 255.255.255.0

What I want now is for clients to connect to MYNETWORKNAME and have internet access.

I load the interfaces file with: /etc/init.d/networking [restart|start|stop] (no network-manager, wicd etc.)

Thanks! (:

share|improve this question

2 Answers 2

up vote 4 down vote accepted

You can run a NAT/Firewall software like Firestarter on the server.

Another solution without running anything is to do the NAT manually with iptables on NAT Table postrouting using Masquerade on your output external interface (eth0). See rule below:

-A POSTROUTING -o eth0 -j MASQUERADE 

and you will need to enable ip forwarding with:

/bin/echo 1 > /proc/sys/net/ipv4/ip_forward
share|improve this answer

Routing is available in Debian, but disabled by default.

Run the following command:

cat /proc/sys/net/ipv4/ip_forward

If it comes back as "0", then run this next command to set it to 1:

echo 1 > /proc/sys/net/ipv4/ip_forward

If it works after that, make it permanent by adding the following line to /etc/sysctl.conf:

net.ipv4.ip_forward = 1
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.