Last active
          February 18, 2025 23:25 
        
      - 
      
- 
        Save gartnera/31cafc3d0dcdfb5bf0f5a2192e3fbe2c to your computer and use it in GitHub Desktop. 
    systemd service to forward traffic from port 9000 to 9001. Useful for getting around NAT.
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | [Unit] | |
| Description=Forward TCP from 9000 to 9001 (bidirectional) | |
| After=network.target | |
| [Service] | |
| Type=simple | |
| User=nobody | |
| Group=nobody | |
| ExecStart=/usr/bin/socat TCP-LISTEN:9000,reuseaddr,fork TCP:9001 | |
| Restart=always | |
| [Install] | |
| WantedBy=multi-user.target | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
I found the second "TCP-LISTEN" and some more stuff confusing and changed it :-)
/usr/bin/socat TCP-LISTEN:40022,fork TCP:127.0.0.1:22