Bug 449686 - [Chapter 12.2] Network_Devices.xml
Summary: [Chapter 12.2] Network_Devices.xml
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: doc-Virtualization_Guide
Version: 5.2
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Christopher Curran
QA Contact: Don Domingo
URL: http://www.redhat.com/docs/en-US/Red_...
Whiteboard:
Depends On:
Blocks: 449674
TreeView+ depends on / blocked
 
Reported: 2008-06-03 01:26 UTC by Michael Hideo
Modified: 2009-09-02 04:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-02 04:56:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Michael Hideo 2008-06-03 01:26:05 UTC
in the “Configuring NAT…” example why isn’t there any case for status and restart

Comment 1 Christopher Curran 2008-06-05 04:53:20 UTC
needs tech review. My bash is good but I can't be sure I could write the init
script for this. Requesting engineering to write the rest of the init script.

Comment 2 Bill Burns 2008-10-22 13:11:57 UTC
Herbert, can you review this for Chris?

Comment 3 Herbert Xu 2009-03-27 03:35:03 UTC
Sorry what exactly do I need to review? Could you attach it to this bug please? Thanks!

Comment 4 Christopher Curran 2009-05-06 01:37:10 UTC
Configuring NAT for virtualized guests
Network address translation (NAT) allows multiple network address to connect through a single IP address by intercepting packets and passing them to the private IP addresses. You can copy the following script to /etc/init.d/xenLaptopNAT and create a soft link to /etc/rc3.d/S99xenLaptopNAT. this automatically starts NAT at boot time.
NetworkManager and wireless NAT
The script below may not work well with wireless network or NetworkManager due to start up delays. In this case run the script manually once the machine has booted.

#!/bin/bash
PATH=/usr/bin:/sbin:/bin:/usr/sbin
export PATH
GATEWAYDEV=`ip route | grep default | awk {'print $5'}`
iptables -F
case "$1" in
start)
	if test -z "$GATEWAYDEV"; then
	echo "No gateway device found"
    else
	echo  "Masquerading using $GATEWAYDEV"
	/sbin/iptables -t nat -A POSTROUTING -o $GATEWAYDEV -j MASQUERADE
fi
	echo "Enabling IP forwarding"
	echo 1 > /proc/sys/net/ipv4/ip_forward
	echo "IP forwarding set to `cat /proc/sys/net/ipv4/ip_forward`"
	echo "done."
	;;
*)
echo "Usage: $0 {start|restart|status}"
;;
esac

Comment 5 Herbert Xu 2009-05-06 09:42:45 UTC
The script looks fine to me.  Although the "iptables -F" line would kill all iptables rules that were added before this script gets run.

In general this would seem something that's better configured on a per-interface basis.  But I'm no expert when it comes to RHEL configuration.

Thanks!

Comment 6 Christopher Curran 2009-06-29 04:08:46 UTC
I propose this section is removed or marked Xen specific. I think it could be replaced by: http://documentation-stage.bne.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Virtualization/chap-Virtualization-Network_Configuration.html

That method covers using libvirt for NAT and bridging which is our preferred method for RHEL 5.4 (with the introduction of KVM). 

My question is now whether this procedure will work for older versions of RHEL (that is anything earlier than 5.4)?

Comment 8 Daniel Berrangé 2009-06-29 17:16:13 UTC
Yes, AFAIK, the section Mark pointed to should work with all versions of Xen in RHEL5. I've certainly been running that config since 5.2

Comment 9 Christopher Curran 2009-07-01 04:53:19 UTC
Rock, well I shall remore or relabel the old section as Xen legacy.


Note You need to log in before you can comment on or make changes to this bug.