Enable IP forwarding
sysctl -w net.ipv4.ip_forward=1
To enable it in system startup, edit the file /etc/sysctl.conf and set
net.ipv4.ip_forward = 1
iptables
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
service iptables save
Network Configuration
The configuration should be like this
Router:-Connected to the internet provider
IP : 192.168.1.1
Internet Connected System
eth0 (LAN Card 1):-Connected to router
- IP : 192.168.1.10
- Netmask : 255.255.255.0
- Gateway : 192.168.1.1 (IP of the router)
eth1 (LAN Card 2):-Connected to the other system
- IP : 192.168.0.20 (Not the same network as the first card)
- Netmask : 255.255.255.0
- Gateway : 192.168.1.1 (IP of the router)
Second System
LAN Card connected to the first system
- IP : 192.168.0.30
- Netmask : 255.255.255.0
- Gateway : 192.168.0.20 (IP of the second Card in the first system)
No comments:
Post a Comment