From: Kevin C. <kco...@uc...> - 2003-10-31 18:50:58
|
I tried that do port forward ssh but it didnt work iptables -t nat -A PREROUTING -p tcp -d realhost --dport 2200 -j DNAT --to uml_ip:22 I can ping the uml from the host and the host from the uml. i can also ssh to the uml from the host. Any other ideas why the port forwarding wouldnt work? Thanks Kevin ch...@in... wrote: > If I'm following you right your UML is bridged to another IP address on > the same interface as the host. > > You should be able to redirect your ssh connections with a single > iptables command to destination NAT the connection such as: > > iptables -t nat -A PREROUTING -p tcp --destination realhost > --destination-port someport -j DNAT --to UMLip:UMLport > > where realhost and someport are the IP address and port on the host and > UMLip and UMLport are the IP address and port the connection is going to > on the UML machine. The UMLport is optional, if it is omitted the > someport will be used. > > This will work no matter what interface the uml machine is attached to > so long as the host can talk to the UML machine. Make sure your UML > pings first, if you haven't got that far yet. > > Chip Schweiss > > >>-----Original Message----- >>From: kc043105 [mailto:kc0...@ma...] >>Sent: Wednesday, October 29, 2003 8:12 PM >>To: user-mode-linux-user >>Subject: [uml-user] Networking with UML >> >> >>Im trying to setup a UML instance to act as a virtual machine >>on top of a >>real host. What id like to do is be able to ssh to >>realhost:someport and >>have it forwarded to the UML instance. >> >>I tried to follow the howto with little luck. I was able to >>create a tap >>device and setup a bridge but im not sure what to do with it, >>here are the >>commands i executed where $REAL_IP, $BROADCAST and $GW_IP are the ip >>addresses that the host server gets via dhcp on eth1. >> >>/sbin/modprobe tun >>/sbin/modprobe bridge >> >>brctl addbr br0 >>/sbin/ifconfig eth1 0.0.0.0 promisc up >>/sbin/ifconfig br0 $REAL_IP netmask 255.255.255.0 broadcast >>$BROADCAST up >>brctl stp br0 off >>brctl setfd br0 1 >>brctl sethello br0 1 >>brctl addif br0 eth1 >> >>tunctl -u root >>/sbin/ifconfig tap0 0.0.0.0 promisc up >>brctl addif br0 tap0 >> >>route add default gw $GW_IP >> >>What should i do after this point? >> >>Thanks >> >>Cheers >> >>Kevin Conaway >> >> >> >>------------------------------------------------------- >>This SF.net email is sponsored by: SF.net Giveback Program. >>Does SourceForge.net help you be more productive? Does it >>help you create better code? SHARE THE LOVE, and help us help >>YOU! Click Here: http://sourceforge.net/donate/ >>_______________________________________________ >>User-mode-linux-user mailing list >>Use...@li... >>https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user >> > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > User-mode-linux-user mailing list > Use...@li... > https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user > -- Cheers Kevin Conaway |