apt-get update fails

Discussion in 'Installation/Configuration' started by valies, May 2, 2010.

  1. valies

    valies New Member

    I am running Debian Lenny on a server and on a router, both in VMware.

    When running apt-get update, he can't connect to the mirrors. The strange thing is that it worked before with these mirrors.

    sources.list (server)
    #http, ftp
    deb http://security.debian.org/ stable/updates main contrib
    deb ftp://ftp.be.debian.org/debian/ stable main

    interfaces (server)
    #the loopback network interface
    auto lo
    iface lo inet loopback

    #the primary network interface
    auto eth0
    iface eth0 inet static
    broadcast is the router's internal ip address, the external is connected with the host that is running VMware (dhcp). I can ping internet websites from the router as well as the server. So why can't I update apt? I have been searching all over the internet and tried some solutions, but they do not work... I'm hoping you guys can help me out :confused:
  2. sjau

    sjau Local Meanie Moderator

    firewall issue?
  3. valies

    valies New Member

    Maybe? I ran a simple firewall script on my router

    # delete all existing rules.
    iptables -F
    iptables -t nat -F
    iptables -t mangle -F
    iptables -X
    # Always accept loopback traffic
    iptables -A INPUT -i lo -j ACCEPT
    # Allow established connections, and those not coming from the outside
    iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    iptables -A INPUT -m state --state NEW -i ! eth1 -j ACCEPT
    iptables -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
    # Allow outgoing connections from the LAN side.
    iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
    # Masquerade.
    iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
    # Don't forward from the outside to the inside.
    iptables -A FORWARD -i eth1 -o eth1 -j REJECT
    # Enable routing.
    echo 1 > /proc/sys/net/ipv4/ip_forward
  4. falko

    falko Super Moderator ISPConfig Developer

    Does it work when you switch off the firewall?
  5. Ben

    Ben ISPConfig Developer ISPConfig Developer

    Did you hit ping with the internet ip-adresses or with the dns names (or in other words, does DNS work for you?)
  6. valies

    valies New Member

    Yup, DNS was working succesfully.

    I found the problem... I was working wireless, and NAT or bridged do not always work in VMware when connecting wireless to the internet... My bad :eek: But I'm glad it's working now. Thx all for the kind replies.

Share This Page