Posts: 9
bingel
Joined: 14 Mar 2017
#1
apt-get doesn't work after setting static ip.

My antix version is core.

My /etc/network/interfaces:

Code: Select all

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.10.10
netmask 255.255.255.0
gateway 192.168.10.1
network 192.168.10.0
broadcast 192.168.10.255
dns-nameservers 192.168.10.1
Already tried to comment some lines but did not solve.

Tried to put antix repos ip and names in /etc/hosts but did not solve.

No problem if I use dhcp instead than a static address.

Some help? ...thanks in advance
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#2
dns-nameservers 192.168.10.1
This line seems suspect. Are you are running a local DNS resolver? (few people do so)
I would retest after changing that line to dns-nameservers 8.8.8.8 (google public dns resolver) or the DNS server provided by your ISP.
Posts: 9
bingel
Joined: 14 Mar 2017
#3
It's router's IP where opendns servers are already configured.
However you are right (I forgot to reset that line ...it was just a test) but I have already tried google dns and opendns without success.
Moreover, with that line (dns-nameservers 192.168.10.1) I'm able to ping domain names without problems (only apt-get doesn't run).

More details:
/etc/resolv.conf is OK. It is updated correctly by that line.
Posts: 9
bingel
Joined: 14 Mar 2017
#4
up
dolphin_oracle
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#5
could you go ahead and connect via dhcp and post the

ifconfig

output please.
Posts: 9
bingel
Joined: 14 Mar 2017
#6
Static:

Code: Select all

$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:45:f2:88:aa:10  
          inet addr:192.168.10.10  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::240:f4ff:fe8a:5a90/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1807 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1753 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:147208 (143.7 KiB)  TX bytes:254069 (248.1 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:2919 (2.8 KiB)  TX bytes:2919 (2.8 KiB)
DHCP:

Code: Select all

$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:45:f2:88:aa:10  
          inet addr:192.168.10.4  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::240:f4ff:fe8a:5a90/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:142 errors:0 dropped:0 overruns:0 frame:0
          TX packets:203 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:17996 (17.5 KiB)  TX bytes:23026 (22.4 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:86 errors:0 dropped:0 overruns:0 frame:0
          TX packets:86 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:7959 (7.7 KiB)  TX bytes:7959 (7.7 KiB)
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#7
and

Code: Select all

cat /etc/resolv.conf
for both.

and a single

Code: Select all

inxi -r
Posts: 9
bingel
Joined: 14 Mar 2017
#8
In /etc/resolv.conf I have in both cases:

Code: Select all

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.10.1
however I have already tried other dns servers (google, opendns) without success (as already said, I've already done various tests).

Code: Select all

$ sudo inxi -r
Repos:     Active apt sources in file: /etc/apt/sources.list.d/antix.list
           deb http://nl.mxrepo.com/antix/jessie/ jessie main nosystemd
           Active apt sources in file: /etc/apt/sources.list.d/debian-stable-updates.list
           deb http://ftp.it.debian.org/debian/ jessie-updates main contrib non-free
           Active apt sources in file: /etc/apt/sources.list.d/debian.list
           deb http://ftp.it.debian.org/debian/ jessie main
           deb http://security.debian.org/ jessie/updates main
However repos should be ok because with DHCP I have no problems. apt-get doesn't run only when I set a static address.


PS: could you let me know how to correctly restart the network (and services in general)? Because with these commands:

Code: Select all

sudo service networking stop; sudo service networking start
I'm unable to obtain an ip address when I'm on DHCP so I need to restart the machine. Instead, when I'm on STATIC, when I try to restart network, I have problems only with DNSs (/etc/resolv.conf is not updated) and setting them manually is not a solution (even restarting resolvconf service).

Is it preferable to run /etc/init.d/demon_name start/stop?

Moreover, I've seen (running sysv-rc-conf) that"networking" service is disabled so this should means that network is started/stopped in other way.

More details:
I've already tried to remove dhcp related packages and to reinstall all the system with the hope to solve instead problem persists. I think about to open a bug. How could I do?
Posts: 9
bingel
Joined: 14 Mar 2017
#9
Just installed Antix Core in VirtualBox.
Same steps than previous installation on physical machine.
On VirtualBox (ethernet card configured in bridged mode) I have no problems with apt-get after setting static ip.

Maybe a problem related to my physical machine that has an old VIA C3 cpu without"pae" support"cmov" and"cx8" or with its ethernet card.


EDIT: I have created a"raw" image from virtualbox"vdi" file then I copied the raw image on the physical machine hdd. Now apt-get works correctly even with a static ip address. I write the steps executed as a refresher:

Code: Select all

VBoxManage internalcommands converttoraw antix.vdi antix.img
dd if=antix.img of=/dev/sdN bs=4M
EDIT_2: When I installed Antix on VirtualBox, I setted 192.168.10.20 as IP (static) and apt-get was working. After transferring the virtual machine on the physical machine, as a test, I have changed my static IP address from 192.168.10.20 to 192.168.10.10, restarted network (then restarted also the machine) and apt-get was no working anymore. Resetted IP to 192.168.10.20 and apt-get worked again. Very very very odd!!! Maybe a problem with ethernet card drivers? I do not know what to think.
Last edited by bingel on 04 Apr 2017, 23:13, edited 2 times in total.
Posts: 4,164
rokytnji
Joined: 20 Feb 2009
#10
Not my area of expertise but have you read


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://www.jeffgeerling.com/blog/2016/setting-static-ip-address-raspbian-jessie-lite-on-raspberry-pi"
linktext was:"https://www.jeffgeerling.com/blog/2016/ ... spberry-pi"
====================================


yet.
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#11
I would set your ip address outside the range of your dhcp.

I don't know it that's the problem, but if you don't it's possible to have collisions.
Posts: 9
bingel
Joined: 14 Mar 2017
#12
Great suggestion dolphin_oracle but I have finally SOLVED: since changing the IP address (static) from 192.168.10.10 to any other address, apt-get was working, I began to think of a problem with the router/firewall (although I had already checked router settings). In fact, entering the router with telnet, I could see that following rules were set in iptables:

Code: Select all

DROP       tcp  --  192.168.10.10        anywhere           tcp dpt:smtp 
DROP       tcp  --  192.168.10.10        anywhere           tcp dpt:443 
DROP       tcp  --  192.168.10.10        anywhere           tcp dpt:www 
In practice I have confused"IP Filters" with"Portforwarding" (masks for entering data are identical therefore it can easily happen), and so, instead of forwarding these ports, I had prevented that IP 192.168.10.10 could initiate connections on these ports. Obviously I setted these rules many days ago (working, furthermore, to another machine) and I had completely forgotten. Bad luck did the rest.

Please forgive me for the time I have made You waste.
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#13
Lol! I'm glad you figured it out! Thanks for letting us know.
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#14
Glad you found a fix. So no bug report needed __{{emoticon}}__