[Solved]Automatically activate USB-to-Ethernet adapter upon

This forum is for discussion about general software issues.

[Solved]Automatically activate USB-to-Ethernet adapter upon

Postby geeman » Fri Jan 02, 2015 8:22 pm

I am running the latest Arch Linux ARM release on a Pogoplug 4 device (Model POGO-V4-A3-01). Presently, upon re-boot, I obtain the output below. When I boot, I'd like enp0s1u1 to be automatically active just like eth0, so that if the USB-to-Ethernet adapter is connected to my network, an IP will be assigned to the Pogoplug device, and I can use enp0s1u1 instead of eth0.

What do I need to do?

--------------------------------------------------------

[root@alarm ~]# ifconfig -a
enp0s1u1: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether a0:ce:c8:01:d1:e1 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.121 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::225:31ff:fe04:3766 prefixlen 64 scopeid 0x20<link>
ether 00:25:31:04:37:66 txqueuelen 1000 (Ethernet)
RX packets 146 bytes 17067 (16.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 136 bytes 14848 (14.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 11

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 166 bytes 13138 (12.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 166 bytes 13138 (12.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@alarm ~]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:25:31:04:37:66 brd ff:ff:ff:ff:ff:ff
3: enp0s1u1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether a0:ce:c8:01:d1:e1 brd ff:ff:ff:ff:ff:ff

[root@alarm ~]# uname -a
Linux alarm 3.18.1-1-ARCH #1 PREEMPT Tue Dec 23 02:43:32 MST 2014 armv5tel GNU/Linux
Last edited by pepedog on Sat Jan 03, 2015 4:30 pm, edited 1 time in total.
Reason: Marked as solved
geeman
 
Posts: 7
Joined: Fri Jan 02, 2015 8:14 pm

Re: Automatically activate USB-to-Ethernet adapter upon boot

Postby pepedog » Fri Jan 02, 2015 8:41 pm

Edit the file in /etc/systemd/network
I think it is called eth0, edit Name= line
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Automatically activate USB-to-Ethernet adapter upon boot

Postby geeman » Fri Jan 02, 2015 9:06 pm

Within /etc/systemd/network, there is a single file, eth0.network, with contents:

[Match]
Name=eth0

[Network]
DHCP=both


Do I create a new one, enp0s1u1.network, with the same contents (except Name=enp0s1u1)? Or something else?
geeman
 
Posts: 7
Joined: Fri Jan 02, 2015 8:14 pm

Re: Automatically activate USB-to-Ethernet adapter upon boot

Postby pepedog » Fri Jan 02, 2015 9:14 pm

No, just edit file eth0.network so line is Name=enp0s1u1
The filename has nothing to do with the interface name. Rename it to external.network if you like
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Automatically activate USB-to-Ethernet adapter upon boot

Postby technosf » Sat Jan 03, 2015 1:03 am

The interface can be renamed if you want something shorter, say eth1. Edit or create file 10-network.rules in directory /etc/udev/rules.d:
$this->bbcode_second_pass_code('', 'SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="a0:ce:c8:01:d1:e1", NAME="eth1"')

Then reference eth1 in the eth1.network file in /etc/systemd/network to have it activate at boot.
[size=85] MochaBin 5G || NSA325 [/size]
technosf
 
Posts: 147
Joined: Sat Jan 08, 2011 10:54 pm

Re: Automatically activate USB-to-Ethernet adapter upon boot

Postby geeman » Sat Jan 03, 2015 12:43 pm

Thanks. I neglected to mention that for my application, I need both the built-in Ethernet port and the USB Ethernet adapter port to be active, upon boot. How do I ensure that both the built-in Ethernet port and the USB-to-Ethernet adapter are active, upon boot? Or will your instructions above accomplish this?
geeman
 
Posts: 7
Joined: Fri Jan 02, 2015 8:14 pm

Re: Automatically activate USB-to-Ethernet adapter upon boot

Postby pepedog » Sat Jan 03, 2015 1:11 pm

Copy the .network file, edit one
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Automatically activate USB-to-Ethernet adapter upon boot

Postby geeman » Sat Jan 03, 2015 1:34 pm

So, within /etc/systemd/network, I would have two files, eth0.network and enp0s1u1.network, with the latter containing:

[Match]
Name=enp0s1u1

[Network]
DHCP=both


Correct?
geeman
 
Posts: 7
Joined: Fri Jan 02, 2015 8:14 pm

Re: Automatically activate USB-to-Ethernet adapter upon boot

Postby pepedog » Sat Jan 03, 2015 2:46 pm

yes
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Automatically activate USB-to-Ethernet adapter upon boot

Postby geeman » Sat Jan 03, 2015 3:56 pm

Works. Thanks. Post can be marked [Solved]. Is this my job, or a moderator's?
geeman
 
Posts: 7
Joined: Fri Jan 02, 2015 8:14 pm


Return to General

Who is online

Users browsing this forum: No registered users and 11 guests