You are not logged in.

#1 2012-04-23 21:49:31

Smarthound
Member
Registered: 2012-03-29
Posts: 23

[SOLVED] Bring up ethernet interface without connection

I have two ethernet interfaces in my computer. eth0 connects to the router for the internet, I'm not concerned about that. eth1 I use sometimes to plug a laptop into, and sometimes a MS Windows games PC. Most of the time I don't use it, and there's nothing plugged into it.

I have

NETWORKS=(eth0 eth1)

in rc.conf, and this in /etc/network.d/eth1:

CONNECTION='ethernet'
DESCRIPTION='Internal network'
INTERFACE='eth1'
IP='static'
ADDR='192.168.1.1'

At first boot, there's usually nothing plugged in to eth1, so the 'eth1' profile fails to start:

> sudo netcfg eth1
:: eth1 up                                                                                        [BUSY]  > No connection 
                                                                                                  [FAIL]
> ip addr show eth1
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:1b:ee:00:fe:d6 brd ff:ff:ff:ff:ff:ff

Why won't it start up eth1? I want it to give eth1 the IP of 192.168.1.1, even though there's no cable in it. This causes a problem when, after starting the main PC, I plug in a cable to eth1 and start a device (eg. laptop). I have to plug it in, start up the device (which is set to get a DHCP IP from my computer), manually start up eth1 on the PC, then rerun the connect command from the device.

Last edited by Smarthound (2012-04-26 22:34:54)

Offline

#2 2012-04-23 22:22:14

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: [SOLVED] Bring up ethernet interface without connection

extra/ifplugd


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2012-04-26 21:48:21

Smarthound
Member
Registered: 2012-03-29
Posts: 23

Re: [SOLVED] Bring up ethernet interface without connection

When I start ifplugd:

Apr 26 22:38:23 localhost ifplugd(eth1)[1268]: ifplugd 0.28 initializing.
Apr 26 22:38:23 localhost ifplugd(eth1)[1268]: Using interface eth1/00:1B:EE:00:FE:D6 with driver <r8169> (version: 2.3LK-NAPI)
Apr 26 22:38:23 localhost ifplugd(eth1)[1268]: Using detection mode: SIOCETHTOOL
Apr 26 22:38:23 localhost ifplugd(eth1)[1268]: Initialization complete, link beat not detected.

So far, so good, but when I plug a cable into eth1, the link is detected, waits a few seconds, then fails:

Apr 26 22:43:17 localhost ifplugd(eth1)[4946]: Link beat detected.
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: Executing '/etc/ifplugd/ifplugd.action eth1 up'.
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client: Warning: Your network settings are deprecated.
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:   Please refer to /etc/rc.conf on how to define a single wired
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:   connection, or use a utility such as netcfg.
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client: up: error fetching interface information: Device not found
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client: eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         inet 192.168.0.2  netmask 255.255.255.0  broadcast 192.168.0.255
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         ether 00:1b:4d:4e:c3:d7  txqueuelen 1000  (Ethernet)
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         RX packets 2942  bytes 1534429 (1.4 MiB)
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         RX errors 0  dropped 0  overruns 0  frame 0
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         TX packets 2870  bytes 600353 (586.2 KiB)
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         device interrupt 44  base 0xc000  
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client: eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         ether 00:1b:ee:00:fe:d6  txqueuelen 1000  (Ethernet)
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         RX packets 2  bytes 736 (736.0 B)
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         RX errors 0  dropped 0  overruns 0  frame 0
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         TX packets 0  bytes 0 (0.0 B)
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         device interrupt 19  base 0xe000  
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client: lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436  metric 1
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         inet 127.0.0.1  netmask 255.0.0.0
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         loop  txqueuelen 0  (Local Loopback)
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         RX packets 2497  bytes 1134472 (1.0 MiB)
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         RX errors 0  dropped 0  overruns 0  frame 0
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         TX packets 2497  bytes 1134472 (1.0 MiB)
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client: Usage: inet_route [-vF] del {-host|-net} Target[/prefix] [gw Gw] [metric M] [[dev] If]
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:        inet_route [-vF] add {-host|-net} Target[/prefix] [gw Gw] [metric M]
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:                               [netmask N] [mss Mss] [window W] [irtt I]
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:                               [mod] [dyn] [reinstate] [[dev] If]
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:        inet_route [-vF] add {-host|-net} Target[/prefix] [metric M] reject
Apr 26 22:43:18 localhost ifplugd(eth1)[4946]: client:        inet_route [-FC] flush      NOT supported
Apr 26 22:43:27 localhost ifplugd(eth1)[4946]: Program execution failed, return value is 1.

Do you think it's failing because it's issuing a bad route command? Is my /etc/network.d/eth1 correct (see initial post)?

Offline

#4 2012-04-26 22:01:02

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [SOLVED] Bring up ethernet interface without connection

A daemon to assign a static IP?  WTF?!?

Just put an ifconfig command in rc.local: ifconfig eth1 <address>
I don't know the ip equivalent.

But why it can't just be done through netcfg is beyond me.  Who made that call?  Is it an ip shortcoming?

Last edited by alphaniner (2012-04-26 22:01:58)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#5 2012-04-26 22:32:20

Smarthound
Member
Registered: 2012-03-29
Posts: 23

Re: [SOLVED] Bring up ethernet interface without connection

OK, I'll do that, I just didn't think it was the 'proper' way in Arch. Thanks, alphaniner.

Offline

Board footer

Powered by FluxBB