Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

💾 SSH Route Switcher

Static Badge Static Badge Static Badge

Route SSH hosts through a VPN interface to bypass network conflicts when your local network overlaps with remote SSH destinations.

✨ Features

  • Interactive interface selection - Lists all network interfaces with IP addresses for easy VPN selection
  • Automatic SSH config parsing - Reads HostName entries from your SSH config file
  • Route management - Adds routes with ip route add <ip> dev <interface> metric 10
  • DNS resolution - Resolves hostnames to IPs if your SSH config uses domain names
  • Duplicate detection - Skips routes that already exist

🚀 Quick Start

One-Line Install

curl -fsSL https://raw.githubusercontent.com/peterweissdk-priv/ifswitch_ssh/main/install.sh | bash

Manual Install

# Clone the repository
git clone https://github.com/peterweissdk-priv/ifswitch_ssh.git
cd ifswitch_ssh

# Make executable
chmod +x ifswitch_ssh.sh

# Run the script (requires sudo for route management)
sudo ./ifswitch_ssh.sh

Command Line Options

Option Description
-u, --update Check for updates and install if available
-v, --version Display current version
-h, --help Show help message

⚙️ Requirements

  • Linux with ip command (iproute2)
  • Bash 4.0+
  • Root privileges (sudo) for route management

📋 SSH Config Format

The script parses SSH config files with the following format:

Host        server1
HostName    192.168.1.1
User        root

Host        server2
HostName    192.168.1.2
User        peterweissdk

📝 Directory Structure

ifswitch_ssh/
├── ifswitch_ssh.sh
├── install.sh
├── LICENSE
└── README.md

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

🆘 Support

If you encounter any issues or need support, please file an issue on the GitHub repository.

📄 License

This project is licensed under the GNU GENERAL PUBLIC LICENSE v3.0 - see the LICENSE file for details

Releases

Packages

Contributors

Languages