HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=4)
-   -   apt-get update fails (http://www.howtoforge.com/forums/showthread.php?t=45559)

valies 2nd May 2010 14:11

apt-get update fails
 
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
address 192.168.0.3
gateway 192.168.0.1
netmask 255.255.255.224
network 192.168.0.0
broadcast 192.168.0.31

192.168.0.1 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:

sjau 2nd May 2010 14:34

firewall issue?

valies 2nd May 2010 14:55

Maybe? I ran a simple firewall script on my router

Code:

#!/bin/sh

PATH=/usr/sbin:/sbin:/bin:/usr/bin

#
# 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


falko 3rd May 2010 12:38

Does it work when you switch off the firewall?

Ben 3rd May 2010 21:22

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

valies 3rd May 2010 21:27

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 :o But I'm glad it's working now. Thx all for the kind replies.


All times are GMT +2. The time now is 21:21.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.