You are not logged in.

#1 2013-04-04 14:26:24

axper
Member
Registered: 2013-01-25
Posts: 115

[SOLVED] Network Configuration -- unable to start a service file

I am following this wiki page (Using Static IP address step) and created /etc/systemd/system/network.service as instructed

[Unit]
Description=Connect to the other pc
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-lan.device
After=sys-subsystem-net-devices-lan.device

[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/conf.d/network
ExecStart=/sbin/ip link set dev lan up
ExecStart=/sbin/ip addr add 192.168.1.2/24 dev lan
ExecStart=/sbin/ip route add default via 192.168.1.1

ExecStop=/sbin/ip addr flush dev lan
ExecStop=/sbin/ip link set dev lan down

[Install]
WantedBy=multi-user.target

But I am unable to start network.service

$ sudo systemctl start network
Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details.
$ systemctl status network.service
network.service - Connect to voice
	  Loaded: loaded (/etc/systemd/system/network.service; enabled)
	  Active: failed (Result: resources)
$ sudo journalctl -xn
-- Logs begin at Sat 2013-03-30 03:48:02 AMT, end at Thu 2013-04-04 18:17:46 AMT. --
Apr 04 18:17:26 work sudo[24774]: pam_unix(sudo:session): session closed for user root
Apr 04 18:17:44 work sudo[25354]: void : TTY=pts/0 ; PWD=/etc/systemd/system ; USER=root ; COMMAND=/usr/bin/systemctl start network
Apr 04 18:17:44 work sudo[25354]: pam_unix(sudo:session): session opened for user root by void(uid=0)
Apr 04 18:17:44 work systemd[1]: Starting Connect to the other pc...
-- Subject: Unit network.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/7d4958e842da4a758f6c1cdc7b36dcc5
-- 
-- Unit network.service has begun starting up.
Apr 04 18:17:44 work systemd[1]: Failed to load environment files: No such file or directory
Apr 04 18:17:44 work systemd[1]: network.service failed to run 'start' task: No such file or directory
Apr 04 18:17:44 work systemd[1]: Failed to start Connect to the other pc.
-- Subject: Unit network.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
-- 
-- Unit network.service has failed.
-- 
-- The result is failed.
Apr 04 18:17:44 work sudo[25354]: pam_unix(sudo:session): session closed for user root
Apr 04 18:17:46 work sudo[25421]: void : TTY=pts/0 ; PWD=/etc/systemd/system ; USER=root ; COMMAND=/usr/bin/journalctl -xn
Apr 04 18:17:46 work sudo[25421]: pam_unix(sudo:session): session opened for user root by void(uid=0)

----



Additional info:
I have connected 2 PCs with LAN (Ethernet) cable and want configure them for exchanging files. Both running Arch Linux. I am following the Network Configuration wiki page from the beginning. Didn't have luck with DHCP/dynamic IP, so trying Static IP this time. Restarting the pc with network.service enabled results in same error (in systemctl --failed). Same error message on both PCs.

Trying to run ExecStart lines one by one:

$ sudo /sbin/ip link set dev lan up
$ sudo /sbin/ip addr add 192.168.1.2/24 dev lan
RTNETLINK answers: File exists
$ sudo /sbin/ip route add default via 192.168.1.1
RTNETLINK answers: File exists

Does this mean there already is IP address and route assigned? If so, how to find out which service has done that? Do I need to remove it? Am I following the right wiki page (didn't find another)?

What am I doing wrong and how can I correct this error? / Point me in right direction.

Last edited by axper (2013-04-04 19:26:17)

Offline

#2 2013-04-04 15:02:31

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: [SOLVED] Network Configuration -- unable to start a service file

Do you have a working internet connection with the installation iso?

Offline

#3 2013-04-04 15:23:29

axper
Member
Registered: 2013-01-25
Posts: 115

Re: [SOLVED] Network Configuration -- unable to start a service file

teateawhy wrote:

Do you have a working internet connection with the installation iso?

Yes, I can ping google on both PCs if I boot into arch installation cd.

Internet works fine on both PCs, but I don't need it. I just need to connect 2 computers for exchanging files.

Offline

#4 2013-04-04 15:54:16

henk
Member
From: Weert, Netherlands
Registered: 2013-01-01
Posts: 334

Re: [SOLVED] Network Configuration -- unable to start a service file

I could be wrong on this, but to link 2 pc's directly AFAIN you will need a cross-cable instead of the regular UTP-patch cable.

Offline

#5 2013-04-04 15:57:25

axper
Member
Registered: 2013-01-25
Posts: 115

Re: [SOLVED] Network Configuration -- unable to start a service file

henk wrote:

I could be wrong on this, but to link 2 pc's directly AFAIN you will need a cross-cable instead of the regular UTP-patch cable.

Hmm, I have a cable like this and I have previously successfully connected the same 2 machines with windows installations smile
*EDIT* My cable is called "RJ-45 Ethernet Cable"

Last edited by axper (2013-04-04 16:04:04)

Offline

#6 2013-04-04 16:03:58

henk
Member
From: Weert, Netherlands
Registered: 2013-01-01
Posts: 334

Re: [SOLVED] Network Configuration -- unable to start a service file

That picture is only showing the connectors which indeed are the right ones.

Its about how the wiring is connected in the connectors

http://www.archonmagnus.com/mods/crossO … agram2.jpg

Some of the wires cross over to another connection point

Offline

#7 2013-04-04 16:07:21

axper
Member
Registered: 2013-01-25
Posts: 115

Re: [SOLVED] Network Configuration -- unable to start a service file

It came with the packaging of my router
http://www.tp-link.com/en/products/deta … -8817#spec
It's called "RJ-45 Ethernet Cable", and I have connected 2 PCs with it previously, so it works.

I just need to set up Arch installations for networking.

Offline

#8 2013-04-04 16:12:56

chris_l
Member
Registered: 2010-12-01
Posts: 390

Re: [SOLVED] Network Configuration -- unable to start a service file

henk wrote:

I could be wrong on this, but to link 2 pc's directly AFAIN you will need a cross-cable instead of the regular UTP-patch cable.

Unless if both ethernet ports are gigabit. Those can be connected with a normal cable.
Lets check that first. Install the package ethtool if you don't have it installed yet on both pcs and execute, again on both pcs:

# ethtool eth0

And post the output.


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#9 2013-04-04 16:30:40

axper
Member
Registered: 2013-01-25
Posts: 115

Re: [SOLVED] Network Configuration -- unable to start a service file

PC1 (desktop):

$ sudo ethtool lan
Settings for lan:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	                                     1000baseT/Half 1000baseT/Full 
	Link partner advertised pause frame use: Symmetric Receive-only
	Link partner advertised auto-negotiation: Yes
	Speed: 1000Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: pumbg
	Wake-on: g
	Current message level: 0x00000033 (51)
			       drv probe ifdown ifup
	Link detected: yes

PC2 (laptop):

$ sudo ethtool lan
Settings for lan:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	                                     1000baseT/Half 1000baseT/Full 
	Link partner advertised pause frame use: Symmetric Receive-only
	Link partner advertised auto-negotiation: Yes
	Speed: 1000Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: pumbg
	Wake-on: g
	Current message level: 0x00000033 (51)
			       drv probe ifdown ifup
	Link detected: yes

Last edited by axper (2013-04-04 16:41:52)

Offline

#10 2013-04-04 16:50:46

henk
Member
From: Weert, Netherlands
Registered: 2013-01-01
Posts: 334

Re: [SOLVED] Network Configuration -- unable to start a service file

EnvironmentFile=/etc/conf.d/network

Apr 04 18:17:44 work systemd[1]: Failed to load environment files: No such file or directory

have you checked if the network file exists?

Offline

#11 2013-04-04 18:53:56

axper
Member
Registered: 2013-01-25
Posts: 115

Re: [SOLVED] Network Configuration -- unable to start a service file

henk wrote:
EnvironmentFile=/etc/conf.d/network

Apr 04 18:17:44 work systemd[1]: Failed to load environment files: No such file or directory

have you checked if the network file exists?

Oh thanks, that line was causing problems! Now I do have network.service(s) running on both PC's with this content:

[Unit]
Description=Connect to my desktop/laptop
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-lan.device
After=sys-subsystem-net-devices-lan.device

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ip link set dev lan up
ExecStart=/sbin/ip addr add 192.168.1.2/24 dev lan
ExecStart=/sbin/ip route add default via 192.168.1.1

ExecStop=/sbin/ip addr flush dev lan
ExecStop=/sbin/ip link set dev lan down

[Install]
WantedBy=multi-user.target

I don't get any errors, and this is network's status (on both PCs) when cable is connected

$ sudo systemctl restart network
$ systemctl status network
network.service - Connect to my desktop
	  Loaded: loaded (/etc/systemd/system/network.service; disabled)
	  Active: active (exited) since Thu 2013-04-04 22:43:22 AMT; 8s ago
	 Process: 9761 ExecStop=/sbin/ip link set dev lan down (code=exited, status=0/SUCCESS)
	 Process: 9757 ExecStop=/sbin/ip addr flush dev lan (code=exited, status=0/SUCCESS)
	 Process: 9768 ExecStart=/sbin/ip route add default via 192.168.1.1 (code=exited, status=0/SUCCESS)
	 Process: 9766 ExecStart=/sbin/ip addr add 192.168.1.2/24 dev lan (code=exited, status=0/SUCCESS)
	 Process: 9764 ExecStart=/sbin/ip link set dev lan up (code=exited, status=0/SUCCESS)

And here wiki page is no more help. How can I test connection?

I try to ping, and it works on both machines (if it's the right thing to test?)

$ ping -c3 192.168.1.2
PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.039 ms
64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=0.050 ms
64 bytes from 192.168.1.2: icmp_seq=3 ttl=64 time=0.060 ms

--- 192.168.1.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.039/0.049/0.060/0.011 ms

Now I need to figure out how to share files. Thanks all.

Last edited by axper (2013-04-04 19:04:43)

Offline

#12 2013-04-04 19:06:48

chris_l
Member
Registered: 2010-12-01
Posts: 390

Re: [SOLVED] Network Configuration -- unable to start a service file

Good, it seems you solve it.
Yeah, ping is a good test. If you have ssh on one of the machine, try to ssh.

Don't forget to mark this as [SOLVED]
By the way.

1000baseT/Half 1000baseT/Full

Probably you have guess it, but that means both of your network adapters are gigabit, and thats the reason you don't need an special crossed cable.
Otherwise it would be necessary.


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

Board footer

Powered by FluxBB