Score:0

convert Ip route command to presistent netplan

li flag

I'm totally exhausted about configuring netplan! could somebody help me to add this two command in my netplan?

I added a table mapped to a name: vpn

echo 1000 vpn >> /etc/iproute2/rt_tables

Now we have a custom table 1000 named "vpn"

ip rule add  from 10.10.10.0/24 lookup vpn

finally we add a default route for our custom table 1000 (= vpn)

ip route add default via 192.168.1.1 dev tap_tap proto static table vpn

that command work perfectly. but every reboot they are gone and I have re-enter them. I try to edit netplan but I can't! can somebody help me please?

here is my netplan which I added static Ip to my tap:

network:
version: 2
ethernets:
    ens3:
        addresses:
        - 103.144.189.141/24
        match:
            macaddress: fa:18:2e:5e:41:d1
        mtu: 1500
        nameservers:
            addresses:
            - 8.8.8.8
            - 8.8.4.4
            search: []
        routes:
        -   to: 0.0.0.0/0
            via: 103.144.189.1
        set-name: ens3
    tap_tap:
      dhcp4: no
      addresses:
        - 192.168.2.2/16

this server my domestic server (hop1) which connect to hop2 via softether lan bridgh.(tap interface named :tap_tap)

and I have openconnect server installed on this server.

when client connect to openconnect server(ocserv), ocserv assign a Ip range of 10.10.10.0/24 to client with tap device name vpns.

with that simple command I mentioned earlier I cant rout client to hop 2. but when the server reboot this chain won't work anymore till I re-enter these two code:

ip rule add  from 10.10.10.0/24 lookup vpn

ip route add default via 192.168.1.1 dev tap_tap proto static table vpn

I already read netplan examples and source-routing etc. but I can't figure it out.

Thank for all your help in advanced. Regards

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.