Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T5729: firewall and policy: fix latest migration script #2480

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

nicolas-fort
Copy link
Contributor

Change Summary

Fix migration script

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

firewall
policy-route

Proposed changes

How to test

Content of config file before manually applying migration scripts:

....
....
    ipv4 {
        input {
            filter {
                rule 10 {
                    action "accept"
                    description "Related and Estab"
                    state {
                        established "enable"
                        related "enable"
                    }
                }
                rule 20 {
                    action "drop"
                    description "Invalid"
                    state {
                        invalid "enable"
                    }
                }
                rule 30 {
                    action "return"
                    description "State disabled"
                    state {
                        new "disable"
                    }
                }
            }
        }
        name STATE {
            rule 10 {
                action "accept"
                log "enable"
                state {
                    established "enable"
                    related "enable"
                }
            }
            rule 20 {
                action "accept"
                log "disable"
                state {
                    established "enable"
                    related "disable"
                }
            }
            rule 30 {
                action "accept"
                log "enable"
                state {
                    established "enable"
                }
            }
            rule 66 {
                action "reject"
                state {
                    invalid "disable"
                }
            }
        }
    }
....
....
policy {
    route FOO {
        rule 10 {
            action "accept"
            log "enable"
            state {
                established "enable"
                new "enable"
            }
        }
        rule 20 {
            action "accept"
            log "disable"
            state {
                invalid "enable"
                related "disable"
            }
        }
        rule 30 {
            action "drop"
        }
    }
    route6 FOO6 {
        rule 10 {
            action "accept"
            log "enable"
        }
        rule 20 {
            action "accept"
            log "disable"
        }
        rule 30 {
            action "drop"
        }
        rule 40 {
            action "accept"
            state {
                established "disable"
            }
        }
    }
}

And after applying both migration scripts:

....
    ipv4 {
        input {
            filter {
                rule 10 {
                    action "accept"
                    description "Related and Estab"
                    state "established"
                    state "related"
                }
                rule 20 {
                    action "drop"
                    description "Invalid"
                    state "invalid"
                }
                rule 30 {
                    action "return"
                    description "State disabled"
                }
            }
        }
        name STATE {
            rule 10 {
                log
                action "accept"
                state "established"
                state "related"
            }
            rule 20 {
                action "accept"
                state "established"
            }
            rule 30 {
                log
                action "accept"
                state "established"
            }
            rule 66 {
                action "reject"
            }
        }
    }
....
....
policy {
    route FOO {
        rule 10 {
            log
            action "accept"
            state "established"
            state "new"
        }
        rule 20 {
            action "accept"
            state "invalid"
        }
        rule 30 {
            action "drop"
        }
    }
    route6 FOO6 {
        rule 10 {
            log
            action "accept"
        }
        rule 20 {
            action "accept"
        }
        rule 30 {
            action "drop"
        }
        rule 40 {
            action "accept"
        }
    }
}

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested a review from a team November 14, 2023 10:25
@vyosbot vyosbot requested review from dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team November 14, 2023 10:25
@c-po c-po merged commit 0ba44ec into vyos:current Nov 14, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants