Answer the question
In order to leave comments, you need to log in
How to organize nat before ipsec tunnel?
I have a server on freebsd that establishes an ipsec tunnel to a remote host on the internet. Behind the server there is a grid with gray ip, the server will natit them to the Internet using pf.
ipsec tunnel works on racoon Rule in pf
nat pass from 192.168.1.5/32 to xxxx/32 -> yyyy
It looks like the spdadd rules are fired before translation. I found a similar topic dadv.livejournal.com/202710.html
But it seems that pf cannot have this.
Answer the question
In order to leave comments, you need to log in
For MySQL version 5.6, 5.7 you can do this
CREATE DATABASE test;
use test;
CREATE TABLE t (a varchar(255), b varchar(255));
-- повесим триггер на INSERT
-- триггер будет брать значение из "...." и вставлять его в поле 'b'
CREATE TRIGGER before_insert_test_t
BEFORE INSERT ON test.t
FOR EACH ROW
SET new.b = SUBSTRING_INDEX(SUBSTRING_INDEX(new.a, '"', 2), '"', -1);
INSERT INTO t (a) VALUES('text text "QWERTY" text text');
SELECT * FROM t;
+------------------------------+--------+
| a | b |
+------------------------------+--------+
| text text "QWERTY" text text | QWERTY |
+------------------------------+--------+
CREATE TABLE t
(
a varchar(255),
b varchar(255) default (SUBSTRING_INDEX(SUBSTRING_INDEX(a, '"', 2), '"', -1);)
);
I correctly understood that in the example you indicated a specific number of the occurrence of the separator, but what if this code can be located in a random place in the text, and even in several places?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question