Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Need help setting up my Linux box as gateway

    Okay i've got a slackware box with two ethernet cards. My first card (eth0) connects to my adsl modem, and the second (eth1) connects to my switch, which is connected to workstations.

    eth0 gets its address assigned from the modem/internet. its IP address changes but gateway is its DNS is

    eth1 settings is
    IP: Subnet

    one of my workstation settings is
    IP: Subnet: Gateway: DNS:

    When i use the route command to activate my gateway

    route add -net netmask gw dev eth1

    Its saids network unreachable. How do i resolve this?
    also when i type route, it saids its default gateway is dslgw-211.29.13 im sure this is refering to the gateway , Why does it say that??
    im new to routing, can anyone help me resolve these issues so i can gain internet access to my workstations. Cheers

  2. #2
    Linux Enthusiast KenJackson's Avatar
    Join Date
    Jun 2006
    Maryland, USA

    a couple things

    Quote Originally Posted by chris_roto_123
    eth0 gets its address assigned from the modem/internet. its IP address changes but gateway is its DNS is
    What is doing there? The IP address of eth0 must be in the network of the gateway, so it must be something like 211.29.xx.xx.

    There are two important things to consider:

    ONE: Your PC absolutely can't do any routing unless you have the ip_forward bit set. Type this command:
    /sbin/sysctl net.ipv4.ip_forward

    It must respond like this:
    net.ipv4.ip_forward = 1

    If not, edit /etc/sysctl.conf and add a line that says "net.ipv4.ip_forward = 1". There are a couple other ways of achieving this, which I forget.

    TWO: Make sure you know for sure which ethernet card is which. Udev swapped mine (Yes! changed eth0 to eth1 and vice versa) a while ago when I upgraded the kernel and I spent a day trying to figure out why the network was screwed up.

  3. #3
    Yep Ive considered both things, IP forwarding script is activated on startup, i did that by making rc.ip_forward in /etc/rc.d executable. I tried your way as well, which made no difference. As for thats what it saids on eth0 from my ISP, i can ping it so i dont think theres anything wrong with it?, i hope. Anyone else got any idea's

  4. $spacer_open
  5. #4
    Just Joined! pcrack's Avatar
    Join Date
    May 2006


    try to configure ur gateway/linux box too as a DNS caching nameserver, and use iptables in order to
    work this on ur gateway linux box, in short ur gateway and DNS is on the same server i dont think is valid DNS. try asking ur ISP ur public DNS server ip address.

Posting Permissions

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