Comments (7)
If it is possible in OpenWRT, then I would like to think it is within the scope of netctl :-).
Let's see whether it is already possible. If not, we need to find out how to do it manually and then implement it in netctl.
I am not entirely sure what you want. Would something like the following achieve what you are after?
/etc/netctl/MyPPP
Description='My PPPoE connection'
BindsToInterfaces=eth0
Interface=ppp1
Connection=ppp
User='[email protected]'
Password='very secret'
# etc.
/etc/netctl/MyMacVLAN
Description='Virtual LAN on the MyPPP connection'
BindsToInterfaces=ppp1
After=(MyPPP)
Interface=mac0
Connection=macvlan
# etc.
from netctl.
My configuration process is as follows.
Although the wan0.2 interface was created, if not specify the IP, the running state is failed
$ cat wan0.1
Description='Virtual LAN with random MAC address on interface wan0'
Interface=wan0.1
Connection=macvlan
BindsToInterfaces=wan0
Mode="bridge"
IP=static
Address="192.168.200.2/24"
Gateway="192.168.200.1"
DNS=("192.168.200.1")
$ cat wan0.2
Description='Virtual LAN with random MAC address on interface wan0'
Interface=wan0.2
After=(wan0.1)
Connection=macvlan
BindsToInterfaces=wan0
Mode="bridge"
$ cat pppoe
Description='wan0.2 PPPoE connection'
Interface=wan0.2
After=(wan0.2)
Connection=pppoe
User='username'
Password='password'
...
$ sudo netctl start wan0.1
$ sudo netctl start wan0.2
$ sudo netctl start pppoe
$ netctl status wan0.2
● [email protected] - Networking for netctl profile wan0.2
Loaded: loaded (/usr/lib/systemd/system/[email protected]; static)
Active: failed (Result: exit-code) since Wed 2020-11-18 12:33:26 HKT; 2min 43s ago
Docs: man:netctl.profile(5)
Process: 979 ExecStart=/usr/lib/netctl/network start wan0.2 (code=exited, status=1/FAILURE)
Main PID: 979 (code=exited, status=1/FAILURE)
Nov 18 12:33:26 arch-router systemd[1]: Starting Networking for netctl profile wan0.2...
Nov 18 12:33:26 arch-router network[979]: Starting network profile 'wan0.2'...
Nov 18 12:33:26 arch-router systemd[1]: Started Networking for netctl profile wan0.2.
Nov 18 12:33:26 arch-router network[979]: Neither IP, nor IP6 was specified
Nov 18 12:33:26 arch-router network[979]: Failed to bring the network up for profile 'wan0.2'
Nov 18 12:33:26 arch-router systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Nov 18 12:3``3:26 arch-router systemd[1]: [email protected]: Failed with result 'exit-code'.
$ ip r
default via 192.168.200.1 dev wan0.1
10.152.64.1 dev ppp0 proto kernel scope link src 10.152.75.190
192.168.0.0/24 dev br-lan proto kernel scope link src 192.168.0.1
192.168.200.0/24 dev wan0.1 proto kernel scope link src 192.168.200.2
$ sudo ip route replace default via 0.0.0.0 dev ppp0
$ ip r
default dev ppp0
10.152.64.1 dev ppp0 proto kernel scope link src 10.152.75.190
192.168.0.0/24 dev br-lan proto kernel scope link src 192.168.0.1
192.168.200.0/24 dev wan0.1 proto kernel scope link src 192.168.200.2
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: wan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq state UP group default qlen 1000
link/ether xx:xx:xx:xx:xx:44 brd ff:ff:ff:ff:ff:ff
inet6 fe80::c683:4fff:fe10:7144/64 scope link
valid_lft forever preferred_lft forever
3: lan0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc fq master br-lan state UP group default qlen 1000
link/ether xx:xx:xx:xx:xx:45 brd ff:ff:ff:ff:ff:ff
inet6 fe80::c683:4fff:fe10:7145/64 scope link
valid_lft forever preferred_lft forever
4: lan1: <NO-CARRIER,BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc fq master br-lan state DOWN group default qlen 1000
link/ether xx:xx:xx:xx:xx:46 brd ff:ff:ff:ff:ff:ff
5: lan2: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc fq master br-lan state UP group default qlen 1000
link/ether ``xx:xx:xx:xx:xx:47 brd ff:ff:ff:ff:ff:ff
inet6 fe80::c683:4fff:fe10:7147/64 scope link
valid_lft forever preferred_lft forever
6: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ea:4c:4c:99:27:aa brd ff:ff:ff:ff:ff:ff
inet 192.168.0.1/24 brd 192.168.0.255 scope global br-lan
valid_lft forever preferred_lft forever
inet6 fd00::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::e84c:4cff:fe99:27aa/64 scope link
valid_lft forever preferred_lft forever
7: wan0.1@wan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ca:39:d3:a4:92:c7 brd ff:ff:ff:ff:ff:ff
inet 192.168.200.2/24 brd 192.168.200.255 scope global wan0.1
valid_lft forever preferred_lft forever
inet6 fe80::c839:d3ff:fea4:92c7/64 scope link
valid_lft forever preferred_lft forever
8: wan0.2@wan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ``c2:46:f3:c1:9e:b5 brd ff:ff:ff:ff:ff:ff
inet6 fe80::c046:f3ff:fec1:9eb5/64 scope link
valid_lft forever preferred_lft forever
9: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc fq state UNKNOWN group default qlen 3
link/ppp
inet 10.152.75.190 peer 10.152.64.1/32 scope global ppp0
valid_lft forever preferred_lft forever
from netctl.
Ah, so you want to run PPPoE inside the macvlan. How about this?
/etc/netctl/MyMACVLAN
Description='Virtual LAN for the MyPPP connection'
BindsToInterfaces=eth0
Interface=mac0
Connection=macvlan
Mode=bridge
IP=no
/etc/netctl/MyPPP
Description='My PPPoE connection'
After=(MyMACVLAN)
Interface=mac0
Connection=pppoe
User='[email protected]'
Password='very secret'
# etc.
from netctl.
After I add IP=no to wan0.2 and reboot the system, pppoe will fail
$ netctl status pppoe
● [email protected] - wan0.2 PPPoE connection
Loaded: loaded (/usr/lib/systemd/system/[email protected]; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/[email protected]
└─profile.conf
Active: failed (Result: exit-code) since Thu 2020-11-19 05:18:57 HKT; 2min 41s ago
Docs: man:netctl.profile(5)
Process: 489 ExecStart=/usr/lib/netctl/network start pppoe (code=exited, status=1/FAILURE)
Main PID: 489 (code=exited, status=1/FAILURE)
Nov 19 05:18:57 arch-router systemd[1]: Starting wan0.2 PPPoE connection...
Nov 19 05:18:57 arch-router network[489]: Starting network profile 'pppoe'...
Nov 19 05:18:57 arch-router network[489]: The interface of network profile 'pppoe' is already up
Nov 19 05:18:57 arch-router systemd[1]: [email protected]: Main process exited,
from netctl.
wan0.2 interface is in the up state, pppoe stops the next action
from netctl.
Makes sense, I guess this is a situation where it is okay to add ForceConnect=yes
to /etc/netctl/MyPPP.
from netctl.
Thanks, it solved my problem perfectly
$ ping 192.168.200.1 -c 4
PING 192.168.200.1 (192.168.200.1) 56(84) bytes of data.
64 bytes from 192.168.200.1: icmp_seq=1 ttl=64 time=0.862 ms
64 bytes from 192.168.200.1: icmp_seq=2 ttl=64 time=0.401 ms
64 bytes from 192.168.200.1: icmp_seq=3 ttl=64 time=0.751 ms
64 bytes from 192.168.200.1: icmp_seq=4 ttl=64 time=0.874 ms
--- 192.168.200.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3025ms
rtt min/avg/max/mdev = 0.401/0.722/0.874/0.191 ms
$ ping github.com -c 4
PING github.com (192.30.255.113) 56(84) bytes of data.
64 bytes from lb-192-30-255-113-sea.github.com (192.30.255.113): icmp_seq=1 ttl=47 time=230 ms
64 bytes from lb-192-30-255-113-sea.github.com (192.30.255.113): icmp_seq=2 ttl=47 time=231 ms
64 bytes from lb-192-30-255-113-sea.github.com (192.30.255.113): icmp_seq=3 ttl=47 time=231 ms
64 bytes from lb-192-30-255-113-sea.github.com (192.30.255.113): icmp_seq=4 ttl=47 time=230 ms
--- github.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 230.470/230.611/230.971/0.207 ms
from netctl.
Related Issues (20)
- Ask for password on network connect HOT 3
- [email protected] is not started after interface is inserted HOT 9
- Reduce/remove waiting time for pluggable WiFi devices on startup HOT 9
- netctl-ifplugd Unable to get ip address HOT 3
- [Feature request] Auto retry wifi connection HOT 5
- Add option for accept_ra value HOT 6
- Support stable private IPv6 addresses HOT 4
- Allow regular user to `netctl switch-to <profile>` HOT 2
- [Feature request] Blacklist access points. HOT 10
- NO SSID environment variable HOT 6
- Only one hook works at a time HOT 3
- netctl wanted by multi-user.target, slowing down boot HOT 4
- netctl-auto list_netctl_auto_interfaces() function bug HOT 1
- Add a command for WPS Push Button HOT 4
- Check config file when restart command HOT 5
- When an issue occurs in the ISP, the systemd service of pppoe will fail. HOT 10
- Hook not executed for netctl-auto HOT 8
- Error while executing the script via ExecUpPost HOT 1
- No way to leave resolv.conf alone with DHCP profile (?) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netctl.