You are not logged in.

#1 2018-05-25 06:54:07

vigilian
Member
Registered: 2016-06-05
Posts: 23

netctl + multiple NIC and access point + creation of tables?

Hi,

So it should be a very simple question but apparently it's very difficult to find a straight answer to that.

general case: You have multiple NICs, related to different gateways and subnet (which can be one physical interface and one openvpn with split tunneling or 2 physical or virtual interfaces etc) and you need to be able to reach internet from both sides.
So with ifupdown you had to throw some line for the creation of a route and a table associated with one of the NICs (because you can't have the packets from 2 different links on the same network table).
How do you do that with netctl? Apparently it doesn't do that for you and I can't see anywhere in the doc where there is mention of that.

Offline

#2 2018-05-26 14:23:50

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,347

Re: netctl + multiple NIC and access point + creation of tables?

You'll need to create custom profiles for each connection and stop/start them manually (maybe scripting them will also work).

https://jlk.fjfi.cvut.cz/arch/manpages/ … .profile.5 shows all options for profiles.
I expect you'll find the "IP options"  section useful .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Online

#3 2018-05-28 11:50:39

vigilian
Member
Registered: 2016-06-05
Posts: 23

Re: netctl + multiple NIC and access point + creation of tables?

thanks @Lone_Wolf

so maybe I should go a bit further and review some of the use cases just to be sure that things are clear and are well scripted.

in the openvpn usecase,

it's openvpn client who is creating the adapter -> so no use of script in /etc/netctl
it's openvpn client who is linking to the script of your provider and you need to start it through systemd ...
So should I add a script in netctl about tun0 or something else to create table ?

Because basically when you add a network interfaces and you need to add it as an independent actor in networking you need to do this:

sudo ip rule add from 10.0.0.0/8 lookup 102
sudo ip route add default table 102 dev tun0 via 10.10.0.1

Offline

#4 2018-05-29 13:10:00

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,347

Re: netctl + multiple NIC and access point + creation of tables?

it's openvpn client who is linking to the script of your provider and you need to start it through systemd ...

The vast majority of systemd service-files sets some things, then starts an executable (often a daemon) that has nothing to do with systemd.
Manually / scripted starting the daemon using the same "some things" has exactly the same effect as using the systemd service.

The openvpn wiki page shows how to manually start the vpn client.

-----------------------------------------
I have the feeling I don't know enough about what you want to achieve.

It looks like you used a manual approach to manage your network setup and are now looking into managing that setup with netctl/systemd ?
Please elaborate.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Online

Board footer

Powered by FluxBB