Git Product home page Git Product logo

Comments (7)

joukewitteveen avatar joukewitteveen commented on June 21, 2024

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.

onlymash avatar onlymash commented on June 21, 2024

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.

joukewitteveen avatar joukewitteveen commented on June 21, 2024

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.

onlymash avatar onlymash commented on June 21, 2024

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.

onlymash avatar onlymash commented on June 21, 2024

wan0.2 interface is in the up state, pppoe stops the next action

from netctl.

joukewitteveen avatar joukewitteveen commented on June 21, 2024

Makes sense, I guess this is a situation where it is okay to add ForceConnect=yes to /etc/netctl/MyPPP.

from netctl.

onlymash avatar onlymash commented on June 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.