You are not logged in.

#1 2012-09-02 15:59:13

backmack
Member
Registered: 2012-09-02
Posts: 9

[SOLVED] Netcfg, static ip on a non-active Lan

When the other end of the LAN cable is not connected to the router, Netcfg can't assign a static ip address to the interface. In older version (6 month old) it was working, but with newer version I get a "No connection" error:

[root@backmack:/]# NETCFG_DEBUG="yes" netcfg -u mylan
DEBUG: Loading profile mylan
DEBUG: Configuring interface eth0
:: mylan up                                                                                                                                                                                                                             [BUSY] DEBUG: status reported to profile_up as: 
DEBUG: Loading profile mylan
DEBUG: Configuring interface eth0
DEBUG: ethernet_up bring_interface up eth0
 > No connection
DEBUG: profile_up connect failed

my /etc/network.d/mylan

CONNECTION='ethernet'
DESCRIPTION='mylan'
INTERFACE='eth0'
IP='static'
ADDR='192.168.0.1'
NETMASK='255.255.255.224'

I think this is a bug, it should be possible to assign IP address to a LAN card even it has no cable inserted.

Last edited by backmack (2012-09-03 16:45:55)

Offline

#2 2012-09-02 16:27:30

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: [SOLVED] Netcfg, static ip on a non-active Lan

Can you connect manually (substituting your details, and then assuming you have a valid nameserver in /etc/resolv.conf)?

/sbin/ip link set dev ${interface} up
/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev ${interface}
/sbin/ip route add default via ${gateway}

Offline

#3 2012-09-02 16:37:57

backmack
Member
Registered: 2012-09-02
Posts: 9

Re: [SOLVED] Netcfg, static ip on a non-active Lan

vacant wrote:

Can you connect manually (substituting your details, and then assuming you have a valid nameserver in /etc/resolv.conf)?

/sbin/ip link set dev ${interface} up
/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev ${interface}
/sbin/ip route add default via ${gateway}

Yes it works, after that i can see my eth0 interface with assigned ip address in "ip addr list"

Offline

#4 2012-09-02 16:50:55

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: [SOLVED] Netcfg, static ip on a non-active Lan

Well, I don't know what extra safety measures netcfg is performing, but I found it noticeably slower to connect my static IP compared to using those commands in a custom systemd ".service" file. Maybe someone with greater knowledge could explain if netcfg is waiting for a link response or something.

Offline

#5 2012-09-03 00:27:13

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [SOLVED] Netcfg, static ip on a non-active Lan

$ man netcfg-profiles wrote:

       Miscellaneous options
           IPCFG
               Array of arguments to pass to ip. The power of this options is
               that it allows both simple and complicated routing
               configurations, within the framework of netcfg.

           SKIPNOCARRIER
               ‘yes’/‘no’. Don’t abort interface setup if no carrier is
               found.

Offline

#6 2012-09-03 16:45:17

backmack
Member
Registered: 2012-09-02
Posts: 9

Re: [SOLVED] Netcfg, static ip on a non-active Lan

fukawi2 wrote:
$ man netcfg-profiles wrote:

       Miscellaneous options
           IPCFG
               Array of arguments to pass to ip. The power of this options is
               that it allows both simple and complicated routing
               configurations, within the framework of netcfg.

           SKIPNOCARRIER
               ‘yes’/‘no’. Don’t abort interface setup if no carrier is
               found.

Thank you, [Solved].

Offline

Board footer

Powered by FluxBB