LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-25-2006, 07:15 AM   #1
msabaq
LQ Newbie
 
Registered: Jan 2006
Posts: 3

Rep: Reputation: 0
two interfaces


hi all
i have a proxy on a network with eth0 and i put another NIC with eth1
i put router cable in one eth0 and take the other from eth1 to the switch
i want it to be the default gateway
 
Old 01-25-2006, 07:41 AM   #2
paragn
Member
 
Registered: Jan 2006
Distribution: Red Hat EL5, Fedora 7
Posts: 259

Rep: Reputation: 30
provide more information about your problem Do you want to make that machine as IP forwarder
 
Old 01-25-2006, 06:11 PM   #3
msabaq
LQ Newbie
 
Registered: Jan 2006
Posts: 3

Original Poster
Rep: Reputation: 0
here is more

previous
*******

DSL ====switch ======users and server=


now what i want is
***************

DSL======= server NIC1
serverNIC2=======switch===users
1-i want to enforce users to use proxy not to be optional
2- the server to control users not to be a user

got me ?
 
Old 05-03-2006, 12:45 PM   #4
Skip-DMP
Member
 
Registered: Jan 2006
Distribution: RHEL3
Posts: 97

Rep: Reputation: 15
Answered?

Are you still looking for an answer on this one?
 
Old 05-04-2006, 03:19 AM   #5
msabaq
LQ Newbie
 
Registered: Jan 2006
Posts: 3

Original Poster
Rep: Reputation: 0
yes

searching and waiting
 
Old 05-04-2006, 09:11 AM   #6
Skip-DMP
Member
 
Registered: Jan 2006
Distribution: RHEL3
Posts: 97

Rep: Reputation: 15
Here is how I do it...

I am not sure if this implementation will make it a "proxy" per se, but should make it a gateway if that is your goal...

I use a very basic iptables file:
Quote:
#!/bin/sh

# Configure the network interfaces
# Using variables allows for easy modification

Internet_IP="xxx.xxx.xxx.xxx"
Internet_IFACE="eth1"

LAN_IP="yyy.yyy.yyy.yyy"
LAN_IP_RANGE="yyy.yyy.0.0/16"
LAN_IFACE="eth0"

echo "1" > /proc/sys/net/ipv4/ip_forward

iptables --flush
iptables -t nat --flush
iptables --delete-chain
iptables -t nat --delete-chain

iptables -t nat -A POSTROUTING -o $Internet_IFACE -j SNAT --to-source $Internet_IP
Use the LAN_IP address as your gateway for the systems on your network. You can use fixed addresses on your private side of the network or DHCP. I use DHCP and run it on the same box where I run my gateway. Here are my basics:

Quote:
ddns-update-style none;
ignore client-updates;
authoritative;

shared-network MY-network {

subnet 192.168.0.0 netmask 255.255.255.0 {
# Using the LAN_IP address of my gateway, which matches in the iptables file
# I have a DNS server on my private network and two public ones
# You can limit your range to the addresses you want available
range 192.168.0.10 192.168.0.200;
default-lease-time 172800;
max-lease-time 1209600;
option domain-name-servers 192.168.X.X, Y.Y.Y.Y, Z.Z.Z.Z;
option routers LAN_IP;
option broadcast-address 192.168.0.255;
option subnet-mask 255.255.252.0;
option ip-forwarding off;
}

subnet 192.168.1.0 netmask 255.255.255.0 {
# I use this subnet for fixed addresses (see below) and no access to the gateway
default-lease-time 172800;
max-lease-time 1209600;
option domain-name-servers 192.168.X.X;
option broadcast-address 192.168.1.255;
option subnet-mask 255.255.252.0;
option ip-forwarding off;
}

# This system has no internet access. Unique hostnames and actual MAC address needed.
host no-internet-access {
hardware ethernet 00:00:00:00:00:00;
fixed-address 192.168.1.10;
}


}
Hopefully this is helpful...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with the interfaces... Tomanas Slackware 1 10-09-2005 12:38 PM
interfaces + wifi alaios Linux - Wireless Networking 1 09-26-2005 04:17 PM
interfaces littlemidget Linux - Networking 0 01-04-2005 02:15 PM
2 inner interfaces d_kilshtein Linux - Networking 5 12-19-2004 08:06 AM
Requests on interfaces Deane Linux - Networking 3 01-29-2003 08:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration