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

T160: Add NAT64 #2573

Closed
wants to merge 1 commit into from
Closed

T160: Add NAT64 #2573

wants to merge 1 commit into from

Conversation

sever-sever
Copy link
Member

@sever-sever sever-sever commented Dec 5, 2023

Change Summary

Add NAT64

The original PR #1993
There are no responses from the PR author, and PR had conflicts.

Write fixed for JSON write files and update the base.
Deleted unused default values.
Simple changes.

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

nat64

Proposed changes

How to test

Add a separate address 192.168.122.10 only for nat64 translations

set interfaces ethernet eth0 address '192.168.122.14/24'
set interfaces ethernet eth0 address '192.168.122.10/24'
set interfaces ethernet eth2 address '2001:db8::1/64'

set nat64 source rule 100 source prefix '64:ff9b::/96'
set nat64 source rule 100 translation pool 10 address '192.168.122.10'
set nat64 source rule 100 translation pool 10 port '1-65535'

From the IPv6 host only 2001:db8::2 try to ping IPv4 hosts

vyos@r12:~$ ping 64:ff9b::192.0.2.5 count 2
PING 64:ff9b::192.0.2.5(64:ff9b::c000:205) 56 data bytes
64 bytes from 64:ff9b::c000:205: icmp_seq=1 ttl=63 time=0.586 ms
64 bytes from 64:ff9b::c000:205: icmp_seq=2 ttl=63 time=0.695 ms

--- 64:ff9b::192.0.2.5 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1010ms
rtt min/avg/max/mdev = 0.586/0.640/0.695/0.060 ms
vyos@r12:~$ 
vyos@r12:~$ 
vyos@r12:~$ 
vyos@r12:~$ 
vyos@r12:~$ ping 64:ff9b::1.1.1.1 count 2
PING 64:ff9b::1.1.1.1(64:ff9b::101:101) 56 data bytes
64 bytes from 64:ff9b::101:101: icmp_seq=1 ttl=58 time=29.0 ms
64 bytes from 64:ff9b::101:101: icmp_seq=2 ttl=58 time=20.0 ms

--- 64:ff9b::1.1.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 20.077/24.580/29.083/4.503 ms
vyos@r12:~$ 

DUMP from the NAT64 host

vyos@r4# sudo tcpdump -ni eth0 host 1.1.1.1
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
11:44:58.808642 IP 192.168.122.10 > 1.1.1.1: ICMP echo request, id 6884, seq 1, length 64
11:44:58.828382 IP 1.1.1.1 > 192.168.122.10: ICMP echo reply, id 6884, seq 1, length 64
11:44:59.810503 IP 192.168.122.10 > 1.1.1.1: ICMP echo request, id 6884, seq 2, length 64
11:44:59.830197 IP 1.1.1.1 > 192.168.122.10: ICMP echo reply, id 6884, seq 2, length 64

Jool

vyos@r4# sudo jool instance display
+--------------------+-----------------+-----------+
|          Namespace |            Name | Framework |
+--------------------+-----------------+-----------+
|           b19ee1c0 |    instance-100 | netfilter |
+--------------------+-----------------+-----------+
[edit]
vyos@r4# 

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 review from a team, dmbaturin, sarthurdev, zdc, jestabro and c-po and removed request for a team December 5, 2023 09:45
Add NAT64

The original PR vyos#1993
There are no responces from the author of PR and PR had conflicts

Write fixed for JSON write files and update the base
Deleted unused default values
Simple changes

Example:
```
set nat64 source rule 100 source prefix '64:ff9b::/96'
set nat64 source rule 100 translation pool 10 address '192.168.122.10'
set nat64 source rule 100 translation pool 10 port '1-65535'
```
@runborg
Copy link
Contributor

runborg commented Dec 5, 2023

This PR does not honor the code to its original author (@frebib) , i will down-vote this PR based on this. i've done a rebase of the original PR into this repository: https://github.com/runborg/vyos-1x/tree/nat64, please update your changes to be based around this fork @sever-sever , if you need help doing this i can assist you in doing it.

Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @runborg. This code is derived from the original code by @frebib and the original credit must be preserved. We can make the conflict fixing part a separate commit to better reflect what really happened here.

@sever-sever
Copy link
Member Author

sever-sever commented Dec 6, 2023

@dmbaturin @runborg The new PR #2578 with added the original commit

@sever-sever sever-sever closed this Dec 6, 2023
@sever-sever sever-sever deleted the T160 branch December 23, 2023 12:16
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