You are not logged in.
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.targetBut 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 existsDoes 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
Do you have a working internet connection with the installation iso?
Offline
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
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
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 ![]()
*EDIT* My cable is called "RJ-45 Ethernet Cable"
Last edited by axper (2013-04-04 16:04:04)
Offline
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
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
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 eth0And 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
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: yesPC2 (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: yesLast edited by axper (2013-04-04 16:41:52)
Offline
EnvironmentFile=/etc/conf.d/network
Apr 04 18:17:44 work systemd[1]: Failed to load environment files: No such file or directoryhave you checked if the network file exists?
Offline
EnvironmentFile=/etc/conf.d/network Apr 04 18:17:44 work systemd[1]: Failed to load environment files: No such file or directoryhave 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.targetI 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 msNow I need to figure out how to share files. Thanks all.
Last edited by axper (2013-04-04 19:04:43)
Offline
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/FullProbably 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