Results 1 to 4 of 4

Thread: ubuntu as a router not working/ can't get to internet

  1. #1
    Join Date
    Feb 2007
    Location
    Seattle, WA
    Beans
    146
    Distro
    Ubuntu 10.10 Maverick Meerkat

    ubuntu as a router not working/ can't get to internet

    I am trying to set up a basic router. I am running ubuntu server 10.04(just installed it today!) I have a verizon aircard(mobile broadband card) that is connected via usb. I am using wvdial to "dial-up" the connection. This works just fine and gives me a device on ppp0. There is a single lan connection on eth0 set up as a static ip address under /etc/network/interfaces. I don't even have any firewall running yet. For whatever reason, I can only get out on the internet when eth0 is set to get its ip address through dhcp. When I set it up with a static ip, I get for example:

    $ping 4.2.2.2
    From 192.168.1.1 icmp_seq=1 Destination Host Unreachable.

    $ping google.com
    ping: unknown host google.com


    If, however, after I have booted and the wvdial has been started, I set up eth0 as dhcp, run /etc/init.d/networking restart, set it back as static, run /etc/init.d/networking restart again, all work well. When I reboot the system with the static ip on eth0, and connect to wvdial, I get no internet again. What am I doing wrong?!@?!?

  2. #2
    Join Date
    Sep 2007
    Location
    Masschusetts
    Beans
    1,510
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: ubuntu as a router not working/ can't get to internet

    Quote Originally Posted by senor_smile View Post
    I am trying to set up a basic router. I am running ubuntu server 10.04(just installed it today!) I have a verizon aircard(mobile broadband card) that is connected via usb. I am using wvdial to "dial-up" the connection. This works just fine and gives me a device on ppp0. There is a single lan connection on eth0 set up as a static ip address under /etc/network/interfaces. I don't even have any firewall running yet. For whatever reason, I can only get out on the internet when eth0 is set to get its ip address through dhcp. When I set it up with a static ip, I get for example:

    $ping 4.2.2.2
    From 192.168.1.1 icmp_seq=1 Destination Host Unreachable.

    $ping google.com
    ping: unknown host google.com


    If, however, after I have booted and the wvdial has been started, I set up eth0 as dhcp, run /etc/init.d/networking restart, set it back as static, run /etc/init.d/networking restart again, all work well. When I reboot the system with the static ip on eth0, and connect to wvdial, I get no internet again. What am I doing wrong?!@?!?
    You're going to have to be a little more specific.

    Which connection is going to be your WAN?
    Which is LAN?
    What is your LAN address scheme (IPs and Netmask)?
    Have you enabled IP Forwarding?
    Are you sure the firewall is open?
    What do you mean it works when eth0 is DHCP? If there another DHCP Server on the network somewhere? Is this a stub network (One way in, one way out)?

    Post the output of:

    Code:
    ifconfig
    Code:
    netstat -rn
    Code:
    cat /etc/network/interfaces
    Code:
    sudo iptables -L
    Registered Linux User: 482377
    MacBook (1,1) - OS X Leopard
    ASUS P5LD2 - Core 2 Duo 3.0GHz - 2GB Corsair RAM - Nvidia 8800GT - Ubuntu 9.04 / Windows 7 Professional

  3. #3
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: ubuntu as a router not working/ can't get to internet

    Server (/etc/network/interfaces) or desktop (Network Manager) install? (You did say server, but just to be sure...)
    Did you set up DNS (/etc/resolv.conf), and what are results of route -n?
    Last edited by Iowan; April 30th, 2010 at 03:03 AM.
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

  4. #4
    Join Date
    Feb 2007
    Location
    Seattle, WA
    Beans
    146
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: ubuntu as a router not working/ can't get to internet

    Quote Originally Posted by Iowan View Post
    Server (/etc/network/interfaces) or desktop (Network Manager) install? (You did say server, but just to be sure...)
    Did you set up DNS (/etc/resolv.conf), and what are results of route -n?
    Thanks for all of the advice guys. I figured out that there was a default route being set up that was messing up the internet connection. I fixed it by adding the following in my wvdial startup script:

    Code:
    route add gw dev ppp0
    I left the device at my office so I don't have all of the specifics. I will post the entire set up tomorrow so that any else that might be suffering similar problems can perhaps benefit.

Bookmarks

Posting Permissions

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