Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
eth0 by DHCP, eth0:1 by static and working with wicd
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
comcon1
n00b
n00b


Joined: 23 Apr 2014
Posts: 8

PostPosted: Wed Jun 14, 2017 9:33 am    Post subject: eth0 by DHCP, eth0:1 by static and working with wicd Reply with quote

Good morning, dear friends!

I have wicd and I want to save it to be able to connect wifi selecting the network. But also I have ethernet interface. Is it possible to make eth0 and eth0:1 in this configuration? I want to bind one interface to 192.168.112.* through one gateway and another interface should get IP by DHCP (it is in another subnet). Is it possible to do it with saving wicd? Or how I should do?

Thanks before!
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Wed Jun 14, 2017 10:05 am    Post subject: Reply with quote

No clue regarding wicd, sorry. Did you check https://wiki.gentoo.org/wiki/Dhcpcd#Static_IP_addresses?
Back to top
View user's profile Send private message
comcon1
n00b
n00b


Joined: 23 Apr 2014
Posts: 8

PostPosted: Wed Jun 14, 2017 10:40 am    Post subject: Reply with quote

And what is a basic decision without wicd?

charles17 wrote:
No clue regarding wicd, sorry. Did you check https://wiki.gentoo.org/wiki/Dhcpcd#Static_IP_addresses?
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Wed Jun 14, 2017 12:03 pm    Post subject: Reply with quote

comcon1 wrote:
And what is a basic decision without wicd?

It's up to you. What I use is this approach with net-misc/netifrc banned from my system.
Back to top
View user's profile Send private message
comcon1
n00b
n00b


Joined: 23 Apr 2014
Posts: 8

PostPosted: Wed Jun 14, 2017 1:02 pm    Post subject: Reply with quote

charles17 wrote:
comcon1 wrote:
And what is a basic decision without wicd?

It's up to you. What I use is this approach with net-misc/netifrc banned from my system.


I mean - what is basic decision for using two interfaces for one eth0? Imaging that I do not use wifi at all. In debian it is possible to configure eth0 and eth0:1 with static and dhcp. What is the basic decision for the same thing in gentoo. I feel that it is rather simple but I can't find it.
Back to top
View user's profile Send private message
comcon1
n00b
n00b


Joined: 23 Apr 2014
Posts: 8

PostPosted: Wed Jun 14, 2017 1:08 pm    Post subject: Reply with quote

May be I misunderstand you. Do netifrc allow everythin that I need? If yes - I will study its manual.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Wed Jun 14, 2017 1:38 pm    Post subject: Reply with quote

comcon1 wrote:
Do netifrc allow everythin that I need?
I have no idea what you need or want.

comcon1 wrote:
... for using two interfaces for one eth0?
Network interfaces are what you get listed using either of tree /sys/class/net or ifconfig -a and there should be only one network interface called eth0.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Jun 15, 2017 10:44 am    Post subject: Reply with quote

comcon1 wrote:
I mean - what is basic decision for using two interfaces for one eth0? Imaging that I do not use wifi at all. In debian it is possible to configure eth0 and eth0:1 with static and dhcp. What is the basic decision for the same thing in gentoo. I feel that it is rather simple but I can't find it.


eth0:0 and eth0:1 are interface aliases.
Their sole purpose in life is to allow the ifconfig(8) tool to assign more than one address to eth0.

Luckily, Linux has moved on from this and now follows the BSD families where you just assign many addresses to eth0 and don't have to use aliases anymore.
To see your addresses, use iproute2(8) like so

Code:
ip a


While dhcpcd does not support a static AND dynamic configuration at the same time, it is possible to achieve this a custom hook like so
(untested, typed straight in here, may have errors, but you get the idea)

Code:
# /etc/dhcpcd.exit-hook
# Assign a static IP on start
if [ "$interface" = eth0 -a "$reason" = PREINIT ]; then
    ip a a 10.1.2.3/24 dev "$interface"
fi

_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
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