View previous topic :: View next topic |
Author |
Message |
comcon1 n00b
Joined: 23 Apr 2014 Posts: 8
|
Posted: Wed Jun 14, 2017 9:33 am Post subject: eth0 by DHCP, eth0:1 by static and working with wicd |
|
|
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 |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
|
Back to top |
|
|
comcon1 n00b
Joined: 23 Apr 2014 Posts: 8
|
Posted: Wed Jun 14, 2017 10:40 am Post subject: |
|
|
And what is a basic decision without wicd?
|
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Wed Jun 14, 2017 12:03 pm Post subject: |
|
|
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 |
|
|
comcon1 n00b
Joined: 23 Apr 2014 Posts: 8
|
Posted: Wed Jun 14, 2017 1:02 pm Post subject: |
|
|
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 |
|
|
comcon1 n00b
Joined: 23 Apr 2014 Posts: 8
|
Posted: Wed Jun 14, 2017 1:08 pm Post subject: |
|
|
May be I misunderstand you. Do netifrc allow everythin that I need? If yes - I will study its manual. |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Wed Jun 14, 2017 1:38 pm Post subject: |
|
|
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 |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Thu Jun 15, 2017 10:44 am Post subject: |
|
|
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
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 |
|
|
|