Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Confusion with static ip on LAN
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
zje
n00b
n00b


Joined: 06 Sep 2012
Posts: 31

PostPosted: Thu Sep 06, 2012 8:33 pm    Post subject: Confusion with static ip on LAN Reply with quote

I installed an additional nic to give my gentoo box access to a separate LAN. I'm trying to configure it for a static ip, but instead of just setting up "eth1" with the ip, it creates a virtual interface "eth1:1"

I.E.
Code:

host ~ # cat /etc/conf.d/net
# 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 :]!).

config_eth0="dhcp"

config_eth1="10.0.0.20 netmask 255.255.255.0"

host ~ # ifconfig eth1       
eth1      Link encap:Ethernet  HWaddr 00:1c:21:20:1f:15 
          inet addr:169.254.4.121  Bcast:169.254.255.255  Mask:255.255.0.0
          inet6 addr: fe80::21b:21ff:fe20:1e14/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4788 (4.6 KiB)  TX bytes:4759 (4.6 KiB)

host ~ # ifconfig eth1:1
eth1:1    Link encap:Ethernet  HWaddr 00:1c:21:20:1f:15
          inet addr:10.0.0.20  Bcast:10.0.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1


Configuring it manually with ifconfig does the trick:
Code:

zakbox ~ # ifconfig eth1:1 down
zakbox ~ # ifconfig eth1 10.0.0.20
zakbox ~ # ifconfig eth1 
eth1      Link encap:Ethernet  HWaddr 00:1c:21:20:1f:15 
          inet addr:10.0.0.20  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::21b:21ff:fe20:1e14/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4788 (4.6 KiB)  TX bytes:5501 (5.3 KiB)


How can I get this to work correctly with the configuration scripts?

Thanks!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Sep 06, 2012 9:27 pm    Post subject: Reply with quote

zje,

Welcome to Gentoo.

It looks like you don't have a /etc/init.d/net.eth1 file.
It should be a symlink to net.lo

With that in place you can do
Code:
rc-update add net.eth1 default

so eth1 is started every boot.

As you get a self assigned IP address (link local) on eth1, it looks like eth1 is being started by hardware detection, correctly not finding a dhcp server then setting itself a link local address.
_________________
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
zje
n00b
n00b


Joined: 06 Sep 2012
Posts: 31

PostPosted: Fri Sep 07, 2012 3:01 am    Post subject: Reply with quote

Thanks! Your answer helped me find out the problem. I already had the symlink and net.eth1 in the default runlevel. However, I did have dhcpcd in the default runlevel instead of "net.eth0" After removing dhcpcd, I added net.eth0 and everything works as expected. :D
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