Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I have seen similar posts, but I was not able to find a solution for my problem. Can you please help me? I am trying to setup a dhcp ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    2

    dhcp server - client cannot connect to the internet


    Hi,
    I have seen similar posts, but I was not able to find a solution for my problem. Can you please help me?

    I am trying to setup a dhcp server (first time in my life). I have a Fedora 12 machine with two NIC, first one for Internet connection:

    DEVICE=eth0
    HWADDR=XX:XX:XX:XX:XX:XX
    ONBOOT=yes
    IPADDR=147.213.192.XX
    BOOTPROTO=none
    NETMASK=255.255.255.0
    DNS2=193.87.10.7
    TYPE=Ethernet
    GATEWAY=147.213.192.1
    DNS1=147.213.192.3
    NM_CONTROLLED=no
    IPV6INIT=no
    USERCTL=no
    FORWARD_IPV4=true


    second one:

    DEVICE=eth1
    PEERDNS=yes
    HWADDR=XX:XX:XX:XX:XX:XX
    ONBOOT=yes
    BOOTPROTO=none
    TYPE=Ethernet
    IPV6INIT=no
    USERCTL=no
    NM_CONTROLLED=no
    IPADDR=192.168.0.1
    NETMASK=255.255.0.0
    BROADCAST=192.168.0.255
    NETWORK=192.168.0.0
    FORWARD_IPV4=true


    the configuration file for dhcpd, /etc/dhcp/dhcpd.conf:

    ddns-update-style ad-hoc;
    default-lease-time 600;
    max-lease-time 86400;
    authoritative;
    subnet 192.168.0.0 netmask 255.255.0.0 {
    range 192.168.0.10 192.168.0.30;
    option routers 192.168.0.1;
    option ip-forwarding on;
    option domain-name-servers 147.213.192.3, 193.87.10.7;
    }


    host margerine {
    hardware ethernet 00:21:85:33:8F:78;
    fixed-address 192.168.0.13;
    option host-name "margerine.saske.sk";
    }

    iptables:
    /etc/rc.local:

    iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
    iptables --append FORWARD --in-interface eth1 -j ACCEPT

    in /etc/sysctl.conf:
    net.ipv4.ip_forward = 1

    I have also added margerine in hosts. And the result?

    I am able to ping from client margerine to both the 192.168.0.1 and XX:XX:XX:XX:XX:XX, but I am not able to connect the Internet or even 147.213.192.3.
    (Connection to internet from server works fine, and also the connection from server to client.)
    As If the forwarding was still denied.

    route:

    147.213.192.0 * 255.255.255.0 U 0 0 0 eth0
    link-local * 255.255.0.0 U 1002 0 0 eth0
    link-local * 255.255.0.0 U 1003 0 0 eth1
    192.168.0.0 * 255.255.0.0 U 0 0 0 eth1
    default 147.213.192.1 0.0.0.0 UG 0 0 0 eth0

    Any idea?

  2. #2
    Just Joined!
    Join Date
    Nov 2007
    Posts
    71
    Hi cpdp,
    I also had the exact problem with the exact settings like yours and this was when i used Fedora 11 & 12, so what i did i installed 8, and it work perfectly well. but one thing you should put in mind is that NetworkManager has buts the the versions i have mentioned, so think you need to try and remove it then edit the ifcfg-ethx files directly.

    #rpm -e NetworkManager
    remember it has applications that depend on it like vpn & gnome so you may need to remove them too.
    #vi /etc/sysconfig/network-script/ifcfg-eth0
    #vi /etc/sysconfig/network-script/ifcfg-eth1

    also make sure you do
    #service iptables save
    #service iptables stop then start


    You dchpd.conf is ok.

    if it fails then i would think install fedora 8 x86-64, i loved it very fast time i used it, it fast and stable.

    Cheers R

  3. #3
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    i would highly recommend against installing an outdated distro like F8

    these are basic functionalities of all linux distros, you do not need to install an old one to get it to work

    after you added forwarding to sysctl.conf did you run sysctl -p command to actually put the values into effect or reboot?

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Feb 2010
    Posts
    2

    solved

    Thanks to both of you. The problem was in the /etc/rc.local file. It wasn't running after reboot. I am not sure why.
    I have tried:
    ln -s /etc/rc.d/rc.local /etc/rc.local
    with the result:
    ln: creating symbolic link '/etc/rc.local' :File exists
    but after reboot everything works fine.

Posting Permissions

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