You are not logged in.

#1 2014-06-04 13:38:23

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

[SOLVED] 2nd static interface is up, but doesn't show an IP address

I must be missing something basic.  I'm in the process of setting up a simple network configuration in order to test out nftables.  I'm using netctl. I have have 2 ethernet ports.  The first interface, eno1, is connected to a router, and works fine.  The second interface, enp2s0, is connected to a switch (for testing NAT behind the firewall) and can't seem to get an IP address.

        Internet --- router --- eno1 --- [server] --- enp2s0 --- 4-port switch
                                                                                       |
                                                                                 test client

[root@ibis etc]# cat /etc/netctl/eno1
Description='A basic static ethernet connection'
Interface=eno1
Connection=ethernet
IP=static
Address=('192.168.1.5/24')
#Routes=('192.168.0.0/24 via 192.168.1.2')
Gateway='192.168.1.1'
DNS=('192.168.1.1')
[root@ibis etc]# cat /etc/netctl/enp2s0
Description='A basic static ethernet connection'
Interface=enp2s0
Connection=ethernet
IP=static
Address=('172.18.90.1/24')
#Routes=('192.168.0.0/24 via 192.168.1.2')
Gateway='192.168.1.5'
DNS=('192.168.1.1')

When I try and bring the 2nd interface up I get an error message:

[root@ibis etc]# netctl start enp2s0
Job for netctl@enp2s0.service failed. See 'systemctl status netctl@enp2s0.service' and 'journalctl -xn' for details.
[root@ibis etc]# systemctl status netctl@enp2s0.service -l
â netctl@enp2s0.service - A basic static ethernet connection
   Loaded: loaded (/etc/systemd/system/netctl@enp2s0.service; enabled)
   Active: failed (Result: exit-code) since Wed 2014-06-04 08:47:36 CDT; 12s ago
     Docs: man:netctl.profile(5)
  Process: 742 ExecStart=/usr/lib/network/network start %I (code=exited, status=1/FAILURE)
 Main PID: 742 (code=exited, status=1/FAILURE)

Jun 04 08:47:36 ibis network[742]: Starting network profile 'enp2s0'...
Jun 04 08:47:36 ibis network[742]: The interface of network profile 'enp2s0' is already up

However, the interface isn't really up, as it doesn't have an IP address:

[root@ibis etc]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 74:d4:35:18:11:36 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.5/24 brd 192.168.1.255 scope global eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::76d4:35ff:fe18:1136/64 scope link
       valid_lft forever preferred_lft forever
3: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 74:d4:35:18:11:34 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::76d4:35ff:fe18:1134/64 scope link
       valid_lft forever preferred_lft forever
4: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0c:8b:fd:75:13:d6 brd ff:ff:ff:ff:ff:ff

and is listed as not active:

[root@ibis etc]# netctl list
  enp2s0
* eno1

I must be doing something wrong, but what?

Last edited by pgoetz (2014-06-04 22:01:36)

Offline

#2 2014-06-04 14:27:50

train_wreck
Member
Registered: 2011-10-22
Posts: 97

Re: [SOLVED] 2nd static interface is up, but doesn't show an IP address

according to ip addr, it looks like it actually does have an IP

[root@ibis etc]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 74:d4:35:18:11:36 brd ff:ff:ff:ff:ff:ff
   [b] inet 192.168.1.5/24 brd 192.168.1.255 scope global eno1[/b]
       valid_lft forever preferred_lft forever
    inet6 fe80::76d4:35ff:fe18:1136/64 scope link
       valid_lft forever preferred_lft forever
3: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 74:d4:35:18:11:34 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::76d4:35ff:fe18:1134/64 scope link
       valid_lft forever preferred_lft forever
4: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0c:8b:fd:75:13:d6 brd ff:ff:ff:ff:ff:ff

have you tried "netctl stop eno1" && :netctl start eno1"?

Offline

#3 2014-06-04 14:43:58

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

Re: [SOLVED] 2nd static interface is up, but doesn't show an IP address

eno1 does have an IP address -- this is the interface that's working.  enp2s0 is the interface which is not coming up.  But yes, I did try

# netctl stop enp2s0
# netctl start enp2s0

Offline

#4 2014-06-04 15:04:41

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

Re: [SOLVED] 2nd static interface is up, but doesn't show an IP address

The interface is up. For example, this is down:

5: net1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000

This is up but disconnected:

5: net1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000

This is up and connected:

5: net1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

Anyway, if the netctl profile is enabled, check your journal to see what happened the first time it was started (it's usually more verbose). I'm no network guru, but maybe it doesn't like using that gateway and dns with that address?

If the netctl profile is not enabled, something else is bringing that interface up.


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 2014-06-04 15:31:24

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

Re: [SOLVED] 2nd static interface is up, but doesn't show an IP address

alphaniner wrote:

The interface is up.

Yeah, I should have been more specific.  The interface is up in the sense of

# ip link set enp2s0 up

but it doesn't have an IP address associated with it.  Also

netctl list

shows that it is not active, as shown in my initial post.

I'm confused about the difference between an interface being upactive,  and how it can be "up" without an IP address in the first place.

The netctl profile is also enabled.

My understanding is the gateway sets the default route, and this interface configuration is similar to a production Ubuntu system I am running as a firewall, so if it's having problems with this, this is worth digging in to more deeply, as you typically get DNS information and non-subnet routing from only one of your interfaces.  I did check the journal when I first tried enabling the interface, but didn't see anything more verbose than what was printed above.

Thanks for the sugestions.

Offline

#6 2014-06-04 15:57:16

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

Re: [SOLVED] 2nd static interface is up, but doesn't show an IP address

pgoetz wrote:

I'm confused about the difference between an interface being upactive,  and how it can be "up" without an IP address in the first place.

'Active' is systemd terminology regarding services and such; it's nothing to do with the interface. Up can mean 'turned on' or 'cable connected' depending on the context. As to how it can be up (turned on) without an IP address, why not? ATA over Ethernet for example works on the 'raw ethernet' level and doesn't require interfaces to have IPs.

Last edited by alphaniner (2014-06-04 16:00:00)


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

#7 2014-06-04 16:02:15

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

Re: [SOLVED] 2nd static interface is up, but doesn't show an IP address

alphaniner wrote:

'Active' is systemd terminology regarding services and such; it's nothing to do with the interface.

Thanks, that's helpful.  The fact that the interface is up, but not active indicates that this might be a systemd level problem.

Last edited by pgoetz (2014-06-04 16:02:40)

Offline

#8 2014-06-04 17:00:30

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: [SOLVED] 2nd static interface is up, but doesn't show an IP address

FWIW “ip addr” is showing the interface as up and connected because the enp2s0 interface does have an “IP” address - an IPv6 link local one.

Offline

#9 2014-06-04 17:34:16

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

Re: [SOLVED] 2nd static interface is up, but doesn't show an IP address

pgoetz wrote:
alphaniner wrote:

'Active' is systemd terminology regarding services and such; it's nothing to do with the interface.

Thanks, that's helpful.  The fact that the interface is up, but not active indicates that this might be a systemd level problem.

I think you're still misunderstanding me. The interface is neither active nor inactive. The systemd service associated with the netctl profile is inactive.

The problem is just as systemctl status told you: the interface was already up when the service tried to start. By default, netctl (actually /usr/lib/network/network) just quits if the interface it's trying to configure is up. You can add ForceConnect=yes to the netctl profile to prevert this, but I must pass on the warning:

man netctl.profile wrote:

...
       ForceConnect=
           Set to ‘yes’ to force connecting even if the interface is up. Do not use this unless you know what you are doing.


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

#10 2014-06-04 21:41:10

branch
Member
Registered: 2014-03-16
Posts: 209

Re: [SOLVED] 2nd static interface is up, but doesn't show an IP address

Try this:
1) Remove the DNS and Gateway lines from /etc/netctl/enp2s0 as they are nonsensical.
2) run the following:

ip link set down enp2s0
ip addr flush enp2s0
netctl reenable enp2s0
netctl start enp2s0

Offline

#11 2014-06-04 22:00:16

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

Re: [SOLVED] 2nd static interface is up, but doesn't show an IP address

Awesome!  That worked.  I had already figured out that the problem was the gateway line from /etc/netctl/enp2s0

journalctl -xn -o verbose

provided this error message.

MESSAGE=Could not set gateway '192.168.1.5' on interface 'enp2s0'

However, after commenting out the offending gateway line and disabling, enabling, and starting the profile,
I was still getting a more cryptic error message:

MESSAGE=Could not add address '172.18.90.1/24' to interface 'enp2s0'

Checking back through my command history it looks like I forgot to take the interface down before attempting to restart to profile.

Offline

Board footer

Powered by FluxBB