Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 152310 Details for
Bug 235392
2.6.21.x kernels: IP MASQUERADE initialization problems
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Mac-On-Linux TUN configuration script
tunconfig (text/plain), 3.26 KB, created by
Joseph Sacco
on 2007-04-11 18:36:47 UTC
(
hide
)
Description:
Mac-On-Linux TUN configuration script
Filename:
MIME Type:
Creator:
Joseph Sacco
Created:
2007-04-11 18:36:47 UTC
Size:
3.26 KB
patch
obsolete
>#!/bin/bash >########################################################################### ># Configuration of the tunN devices for usage with MOL. ># ># This script should be named /etc/mol/tunconfig (unless the default name ># has been changed with the 'tunconfig' keyword). ># ># The molrc file should contain ># ># netdev: tun0 -tun ># ># More information is available in the doc directory. ># ># Usage: tunconfig iface up|down ># ># If the linux box is configured as a firewall, the rules below might ># need some adjustments. ># >############################################################################# > >DNS_REDIRECT=yes # Redirect DNS queries > >#NAMESERVER=10.0.0.1 > >IPTABLES=/sbin/iptables >DHCPD=/usr/sbin/dhcpd > >#################################################################### > >TUN_DEV=$1 >ACTION=$2 > >TUN_NUM=`echo $TUN_DEV | sed s/[^0-9]//g` >NET_NUM=`expr 40 + $TUN_NUM` >TUN_NET=192.168.$NET_NUM.0/24 >TUN_HOST=192.168.$NET_NUM.1 > > >######################################################### ># Misc Checks >######################################################### > >[ $# = 2 ] || { > echo "Usage: tunconfig iface up|down" > exit 2 >} > >[ -x $IPTABLES ] || { > echo "---> $IPTABLES not found." 1>&2 > exit 1 >} > >$IPTABLES -L -n -t nat > /dev/null || exit 1 > > >######################################################### ># Remove old (possibly stale) ruleset >######################################################### > >{ > $IPTABLES -t nat -D POSTROUTING -s $TUN_NET -d ! $TUN_NET -j MASQUERADE > $IPTABLES -t nat -D PREROUTING -p tcp -i $TUN_DEV -d $TUN_HOST --dport 53 -j mol-ns-redirect > $IPTABLES -t nat -D PREROUTING -p udp -i $TUN_DEV -d $TUN_HOST --dport 53 -j mol-ns-redirect > $IPTABLES -t nat -F mol-ns-redirect >} >& /dev/null > > >######################################################### ># Bring down interface >######################################################### > >[ "$ACTION" = down ] && { > /sbin/ifconfig $TUN_DEV down >} > > >######################################################### ># Configure interface >######################################################### > >[ "$ACTION" = up ] && { > /sbin/ifconfig $TUN_DEV $TUN_HOST > > # masquerade the tun network > $IPTABLES -t nat -A POSTROUTING -s $TUN_NET -d ! $TUN_NET -j MASQUERADE > > # DNS redirection > [ "$DNS_REDIRECT" = yes ] && { > [ ! "$NAMESERVER" ] && { > NAMESERVER=`grep ^nameserver /etc/resolv.conf | awk -- '{ print $2 ; exit 0; }'` > [ ! "$NAMESERVER" ] && { > echo "Could not determine the nameserver (localhost is used)." > NAMESERVER=$TUN_HOST > } > } > echo "DHCP nameserver exported: $NAMESERVER" > > $IPTABLES -t nat -N mol-ns-redirect 2> /dev/null > $IPTABLES -t nat -A mol-ns-redirect -j DNAT --to $NAMESERVER > > # redirect tcp/udp port 53 (nameserver queries) > $IPTABLES -t nat -A PREROUTING -p tcp -i $TUN_DEV -d $TUN_HOST --dport 53 -j mol-ns-redirect > $IPTABLES -t nat -A PREROUTING -p udp -i $TUN_DEV -d $TUN_HOST --dport 53 -j mol-ns-redirect > } >} > > >######################################################### ># Start the DHCP >######################################################### > >IFACES=`netstat -i | sed -n -e 's/^\(tun[0-9]\).*/\1/gp'` > >if [ "$IFACES" ] ; then > echo 1 > /proc/sys/net/ipv4/ip_forward >else > $IPTABLES -t nat -X mol-ns-redirect >& /dev/null > #echo 0 > /proc/sys/net/ipv4/ip_forward >fi > >exit 0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 235392
: 152310 |
152311