You are not logged in.

#1 2014-05-11 13:52:21

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,532

How to set netctl to have eth0 up and wifi

I didn't find the clear answer, yet.
My situation require to connect via wifi and a access point hooked on eth0 to serve more wifi users. The system works, but I must enable the eth0 manually.
This is my setting ( a small ASCII drawing )


             +-----------------+                                               +------------+                                                    +------------+                 /
              |    modem/      |                                                |                 |                                                      |                 |                 /
web----   |   router          |-----<< WiFi        WiFi >>-------|  Arch Box |-----Ethernet---------------------------| Access     |-----<<<WiFi -
              |   192.168.1.1 |                          192.168.1.2    |                 |   <192.168.2.2       192.168.2.1> |   Point      |                 \
             +-----------------+                                               +------------+                                                    +------------+                  \

Here's my setting

$ ip route
default via 192.168.1.1 dev wlan0  proto static
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.2  metric 9
192.168.2.0/24 dev eth0  proto kernel  scope link  src 192.168.2.2

During boot I face privoxy failure because it's looking on the ethernet to be available, that it isn't automatically up, as the wifi should take priority.
I configured a profile for route like

 $ cat /etc/netctl/wired
Description='A basic static ethernet connection'
Interface=eth0
#Connection=ethernet
IP=static
Address=('192.168.2.2/24')
Routes=('default metric 1 via 192.168.1.2')
#Gateway='127.0.0.1'
DNS=('127.0.0.1')

DNS is managed by pdnsd. Also the internet sharing is working and iptables is finely set. Only the bother to re-enable the ethernet every boot.
I'm afraid it doesn't start the wired configuration by netctl-systemd, At the moment I don't will to shut down, so I can't ensure that is possible. I most of my trial didn't work, then I just have to do the old style ifconfig eth0 192.168.2.2 netmask 255.255.255.0 up and restart privoxy.

Any advice, please.

Last edited by TheSaint (2014-05-11 13:54:17)


do it good first, it will be faster than do it twice the saint wink

Offline

#2 2014-05-11 16:53:54

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: How to set netctl to have eth0 up and wifi

If I understand correctly, your wifi connection and your ethernet connection are independent. You should create one profile for the wifi connection and one profile for the ethernet connection.

I suspect the problem is your "Routes" line in the ethernet profile.  Try removing it and adding the following gateway setting:

Gateway='192.168.2.1'

When both profiles are correct, you should start them with "netctl start ...".

If both connections are always present at boot, enable the "netctl.service" to restart both profiles at boot.
If the connections are not always present at boot, use the netctl-ifplugd and netctl-auto services. Read the netctl wiki  page for details. I have not used either so I cannot help.

If a profile fails to start, use "systemctl status ..." to check the error messages.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2014-05-12 05:58:37

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,532

Re: How to set netctl to have eth0 up and wifi

The Ethernet connection is used to get into my box (sets as a server), which provide Internet sharing, by some nice junk filtering.
Then for my box the route to Internet is on 192.168.1.1, that is the gateway.
The second route is an incoming route which will follow the the 192.168.1.1 branch. Maybe it's defined as bridge, but it isn't something of my knowledge.

Practically we, family members, might chose either to connect to the modem directly or to my AP, the disadvantage to go directly, conflicts with my box, slower DNS and a big bunch of advertisement.
So, the traffic starts from the right hand side to go to Internet (on the shown sketch). The AP just take newcomers to go to my box, via Ethernet connection.

So yesterday I waited to stop, to much traffic. But this morning I restarted, because of new kernel too, but the netctl profile blatantly failed on me at the first trial. The I got back to the elder style to get things going. But I do believe that it should have a chance to start automatically.

I read the wiki, but no one mention about this kind of lay-out.
Furthermore, I should arrange privoxy to look out this and start after

Last edited by TheSaint (2014-05-12 06:09:25)


do it good first, it will be faster than do it twice the saint wink

Offline

Board footer

Powered by FluxBB