Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Static IP?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1342
Location: Fayetteville, NC, USA

PostPosted: Wed Jun 03, 2015 6:48 pm    Post subject: Static IP? Reply with quote

How do I do this in Gentoo? The Handbook is wrong. If I symlink net.lo to net.enp0s12 and edit the 'net' configuration file during startup it hangs for two minutes claiming that enp0s12 is not ready. Whatever happened to /etc/network/interfaces?
_________________
Ever picture systemd as what runs "The Borg"?
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2546

PostPosted: Wed Jun 03, 2015 6:53 pm    Post subject: Re: Static IP? Reply with quote

The_Great_Sephiroth wrote:
How do I do this in Gentoo? The Handbook is wrong. If I symlink net.lo to net.enp0s12 and edit the 'net' configuration file during startup it hangs for two minutes claiming that enp0s12 is not ready. Whatever happened to /etc/network/interfaces?
It isn't wrong. The problem must exist between the keyboard and the chair. Sorry.

If you want help finding the problem, please show us the files. Also note that you can't have any other networking software (ie wicd) active as they will fight for the interface and interfere with each other.

EDIT: Okay, removing edit
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.


Last edited by The Doctor on Wed Jun 03, 2015 7:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10156
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Jun 03, 2015 7:04 pm    Post subject: Reply with quote

I remembered a translation from old syntax to new but I guess I'd forgotten the context. Erasing my incorrect answer in shame (and also to not confuse posterity, to say nothing of the OP). :wink:

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2583

PostPosted: Wed Jun 03, 2015 8:54 pm    Post subject: Re: Static IP? Reply with quote

The_Great_Sephiroth wrote:
How do I do this in Gentoo? The Handbook is wrong. If I symlink net.lo to net.enp0s12 and edit the 'net' configuration file during startup it hangs for two minutes claiming that enp0s12 is not ready. Whatever happened to /etc/network/interfaces?

Why not simply use the gui?
Back to top
View user's profile Send private message
lexflex
Guru
Guru


Joined: 05 Mar 2006
Posts: 343
Location: the Netherlands

PostPosted: Wed Jun 03, 2015 8:59 pm    Post subject: Re: Static IP? Reply with quote

charles17 wrote:

Why not simply use the gui[/url]?


One might not use a graphical interface.... Or just want the network to be up regardless of typing 'startx'.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42559
Location: 56N 3W

PostPosted: Wed Jun 03, 2015 9:26 pm    Post subject: Reply with quote

The_Great_Sephiroth,

The net.lo script behaves as whatever its called as.

If you have net.enp0s12 -> net.lo, then enp0s12 in your net file, enp0s12 will get started.
I use eth0 as I don't suffer from 'persistent interface names'.

Code:
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /usr/share/doc/openrc/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).

modules="iproute2"

#dhcp_eth0="release nodns nontp nonis nogateway nosendhost"
config_eth0="192.168.100.20/24 brd 192.168.100.255"

############ Switch Routers Helow Here ###########

# old Smoothwall
# routes_eth0="default via 192.168.100.1"

# VM Router
routes_eth0="default via 192.168.100.253"

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1342
Location: Fayetteville, NC, USA

PostPosted: Thu Jun 04, 2015 12:44 pm    Post subject: Reply with quote

Doc, nowhere in the handbook does it state anything about the network interfaces file. This tells me that I must use the "/etc/conf.d/net" file and symlinking net.lo to my interfaces. I followed the guide 100%, so no, the problem does not exist here. Per the guide I symlinked "net.enp0s12" to "net.lo". The configuration file is below.
Code:

nas01 ~ # cat /etc/conf.d/net
config_enp0s12="10.0.4.231/24"
routes_enp0s12="default via 10.0.4.254"
dns_servers_enp0s12="10.0.4.254"

Also, this is on a NAS, so no GUI, no X, nothing. I don't need a static IP on a desktop, normally. The desktops and laptops work fine via Network Manager.

Neddy, I prefer the persistent names. I have had issues on occasion in the past when adding or removing network interfaces in other systems. It is one of the things that I like about Gentoo. The NIC on this server is enp0s12. Funny thing is that the one on my laptop is enp0s25.

So, according to the handbook, my configuration is correct, but it is not working. Just to avoid the question, here is my interface info. I had to walk to the machine and manually assign the address and such displayed here.
Code:

nas01 ~ # ifconfig
enp0s12: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.4.101  netmask 255.255.255.0  broadcast 10.0.4.255
        ether 00:16:ec:ca:6b:3f  txqueuelen 1000  (Ethernet)
        RX packets 99  bytes 12757 (12.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 73  bytes 8726 (8.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 0  (Local Loopback)
        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

_________________
Ever picture systemd as what runs "The Borg"?
Back to top
View user's profile Send private message
dweezil-n0xad
Apprentice
Apprentice


Joined: 30 Oct 2006
Posts: 156
Location: Ostend, Belgium

PostPosted: Thu Jun 04, 2015 1:28 pm    Post subject: Reply with quote

What happens when you start net.enp0s12?

Here's my static ip config on my desktop:
Code:
msi dweezil # cat /etc/conf.d/net
config_eth0="192.168.1.101 netmask 255.255.255.0 brd 192.168.1.255"
routes_eth0="default via 192.168.1.1"
dns_servers_eth0="192.168.1.103"
msi dweezil # /etc/init.d/net.eth0 start
net.eth0           | * Bringing up interface eth0
net.eth0           | *   192.168.1.101 ...                                                                [ ok ]
net.eth0           | *   Adding routes
net.eth0           | *     default via 192.168.1.1 ...                                                    [ ok ]
msi dweezil # ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.101  netmask 255.255.255.0  broadcast 192.168.1.255
        ether 44:8a:5b:9e:29:04  txqueuelen 1000  (Ethernet)
        RX packets 23594  bytes 29011221 (27.6 MiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 16655  bytes 1689839 (1.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 18 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 0  (Local Loopback)
        RX packets 4  bytes 240 (240.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 240 (240.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

_________________
i7-4790K | 16GB DDR3 | GTX 970 | 500GB SSD
ASUS N56VV | i7-3630QM | 12GB DDR3 | GT 750M | 256GB SSD
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1342
Location: Fayetteville, NC, USA

PostPosted: Thu Jun 04, 2015 3:15 pm    Post subject: Reply with quote

I figured out the issue. I had it set to start in the default runlevel, but it wasn't starting. No clue as to why, but deleting it and adding it again fixed it. Now the interface starts and sets the correct IP and routes. Thank you to those who helped.
_________________
Ever picture systemd as what runs "The Borg"?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum