Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have 3 network cards installed in my Ubuntu 10.04 server and I want to configure Internet sharing and file sharing on eth1 for wired users and wlan0 for wireless users through squid and dansguardian. I have configured Dhcp,squid.dansguardian and Hostapd for wireless users

/etc/network/interfaces:
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
 address 192.168.1.15
 netmask 255.255.255.0
 gateway 192.168.1.1

#The secondary network interfaces
auto eth1
iface eth1 inet static
 address 10.0.0.15
 netmask 255.255.255.0

auto wlan0
iface wlan0 inet static
 address 10.0.1.15
 netmask 255.255.255.0

/etc/dhcp3/dhcpd.conf:

ddns-update-style none;
ignore client-updates;
authoritative;
default-lease-time 1209600;
max-lease-time 1814400;
option local-wpad code 252 = text;
option domain-name-servers 192.168.1.15;
option time-offset 0;

subnet 10.0.0.0 netmask 255.0.0.0 {
  option routers 10.0.0.15;
  range 10.0.0.21 10.0.0.30;
}

subnet 10.0.1.0 netmask 255.255.255.0 {
  option routers 10.0.1.15;
  range 10.0.1.21 10.0.1.30

I tried to configure dhcp with same subnet mask for both the eth1 255.0.0.0 and wlan0 255.0.0.0 but gave me bad subnet mask error so i change wlan0 subnet mask to 255.255.255.0 than dhcp service started It doesn't matter in the case of eth1 what subnetmask i used dhcp service works properly

why didn't I receive the error while configuring in /etc/network/interfaces the eth1 and wlan0 I receive error if I try to configure wlan0 to other than 255.255.255.0 subnetmask while configuring dhcp server only

Also how eth1-10.0.0.0/255.0.0.0 and wlan0-10.0.1.0/255.255.255.0 clients are able to ping each other having different network & subnetmask havent added any route also.

Also one more thing my Internet connection is working on wireless clients I haven't configure anything still it works fine bypassing proxy server how ? for wire network eth1 this was not the case I have to configure it write 2 lines of iptables to redirect to port 80 As it is not going through squid not able to fine how it is able to share Internet through wlan0 can u explain me is hostapd playing some role me from where its is sharing Internet smtp is also working fine ????????????????????????????????

I want the wireless client Internet to go through squid and dansguardian that can be done through iptables may be can you tell me the iptables line that should i used to for eth1 and wlan0 when it will shares Internet through dansquardian and other required services may be particular port or all the port both option

I have enable packet forwarding for IPv4 and IPv6 (/etc/sysctl.conf)

I have use iptable following line for eth1 cable user for Internet

/etc/rc.local

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 8080

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

for wlan user i may need to add this

iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j REDIRECT --to-port 8080

The above lines will work for only port 80 is than any better way to put up

But at current from where wireless users are getting Internet connection on port 80??

Thanks for your help

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.