Re: Howto make Firewalld allow remote SSH into a Virtual Machine?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Anthony Messina wrote:
On Wednesday, July 24, 2013 02:55:56 PM Patrick Lists wrote:
[patrick@laptop ~]$ ping 192.168.122.20
PING 192.168.122.20 (192.168.122.20) 56(84) bytes of data.
  From 10.0.0.135 icmp_seq=1 Destination Port Unreachable

Can not ssh from the laptop to the VM:

[patrick@laptop ~]$ ssh 192.168.122.20
ssh: connect to host 192.168.122.20 port 22: Connection refused

To access the VM "through" the host system without using bridged networking,
it seems like you'd need to forward port 22 from the host's IP address to the
VM's IP address via.  You may or may not want to do this for port 22, as you'd
then bypass the ability to access port 22 on the host machine (since it would
be forwarded to the VM).

The bridged network works wonders to solve this issue:
http://wiki.libvirt.org/page/Networking#Host_configuration_2

If you have another IP available, you can bind that to the same NIC and use iptables to forward the connection.
   iptables -p tcp -d 288.41.42.43 --dport ssh -j DNAT 10.40.51.22

or use a non-standard port and send it to the ssh port on the VM. That allows running a stock sshd on the VM.

I have a script in my firewall rules, which defines a bash function to do all the stuff, then a one liner with parameters to do the setup. You can even do some (very) crude load leveling by putting multiple machines on the DNAT rule.

--
Bill Davidsen <davidsen@xxxxxxx>
  "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux