Find the answer to your Linux question:
Results 1 to 8 of 8
Hi, I have a linux box (running Fedora Core 2) that I want to setup as a gateway. eth0 of this machine is connected to the ADSL modem, while eth1 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2004
    Location
    Malta
    Posts
    41

    Internet Connection Sharing


    Hi,

    I have a linux box (running Fedora Core 2) that I want to setup as a gateway. eth0 of this machine is connected to the ADSL modem, while eth1 is configured as a DHCP server (using dhcpd).

    Now I am trying to setup internet connection sharing for machines on my internal network. To do this, I have enabled IP forwarding from /proc/sys/net/ipv4/ip_forward and changed the value of the net.ipv4.ip_forward field in /etc/sysctl.conf. I have also added the following rule to the nat table of the iptables firewall.

    Code:
    iptables -t nat -A POSTROUTING -j MASQUERADE
    The problem is that while I can use ping external IP addresses, the domain name resolution is not working (i.e. I can ping google.com by it's IP address but not by using google.com). This seems to be some kind of DNS problem but I have no idea on how to solve it.

    My dhcp.conf file contains
    Code:
    ddns-update-style interim;
    
    subnet 192.168.0.0 netmask 255.255.255.0
    {
    	option routers 192.168.0.1;
    	option subnet-mask 255.255.255.0;
    	option broadcast-address 192.168.0.255;
    
    	range 192.168.0.2 192.168.0.254;
    }
    Thanks for your time
    is-serp

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    well are you running a DNS server as well?
    -lakerdonald

  3. #3
    Just Joined!
    Join Date
    May 2004
    Location
    Malta
    Posts
    41
    Quote Originally Posted by lakerdonald
    well are you running a DNS server as well?
    -lakerdonald
    No. On my linux box, the primary DNS server is set as the IP of the ADSL modem. The modem then contacts the DNS servers of the ISP but that is transparent to me.

    Thanks
    is-serp

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    perhaps you should set the clients' dns to the actual dns servers themselves, instead of the modem.
    -lakerdonald

  6. #5
    Just Joined!
    Join Date
    May 2004
    Location
    Malta
    Posts
    41
    Quote Originally Posted by lakerdonald
    perhaps you should set the clients' dns to the actual dns servers themselves, instead of the modem.
    -lakerdonald
    I set the primary DNS server of the clients' as the modem's IP address and it works. Is there any way to set the DNS server automatically with DHCP?

    Thanks
    is-serp

  7. #6
    Linux Engineer
    Join Date
    Nov 2004
    Location
    Montreal, Canada
    Posts
    1,267
    I do have the same setup as you, Dynamic IP but, but the modem can connect automaticly to ISP, and my box connect to modem... You need to specify the DNS for this action unfortunatly. They are almost always permanent, My ISP only changed it once in the last 10 years (Sympatico High Speed, Canada) so you shouldnt worry about setting the DNS. You can put it automaticly, but DNS resolving will work 10-15% of the time,... which isnt what your looking for.
    \"Meditative mind\'s is like a vast ocean... whatever strikes the surface, the bottom stays calm\" - Dalai Lama
    \"Competition ultimatly comes down to one thing... a loser and a winner.\" - Ugo Deschamps

  8. #7
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    i think you should just keep the clients the way they are, by just having the dns manually set.
    -lakerdonald

  9. #8
    Just Joined!
    Join Date
    May 2004
    Location
    Malta
    Posts
    41
    Quote Originally Posted by UgoDeschamps
    I do have the same setup as you, Dynamic IP but, but the modem can connect automaticly to ISP, and my box connect to modem... You need to specify the DNS for this action unfortunatly. They are almost always permanent, My ISP only changed it once in the last 10 years (Sympatico High Speed, Canada) so you shouldnt worry about setting the DNS. You can put it automaticly, but DNS resolving will work 10-15% of the time,... which isnt what your looking for.
    Ok man I'll put the DNS manually then.

    Thanks
    is-serp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •