It didnot worked out for me ... So below my configurations
[root@my-hostname root]# sudo /sbin/ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0A:5E:46:8F:6F
inet addr:165.229.192.57 Bcast:165.229.192.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:527 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:354 (354.0 b) TX bytes:31620 (30.8 Kb)
Interrupt:5 Base address:0xc800
eth1 Link encap:Ethernet HWaddr 00:04:76:9D:F1:74
inet addr:192.168.0.4 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6935 errors:0 dropped:0 overruns:1 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:676775 (660.9 Kb) TX bytes:660 (660.0 b)
Interrupt:10 Base address:0xcc00
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1007 errors:0 dropped:0 overruns:0 frame:0
TX packets:1007 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:75356 (73.5 Kb) TX bytes:75356 (73.5 Kb)
[root@my-hostname root]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
165.229.192.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 165.229.192.2 0.0.0.0 UG 0 0 0 eth0
/etc/sysconfig/network
========================================
NETWORKING=yes
HOSTNAME=my-hostname2
FORWARD_IPV4=true
GATEWAY=165.229.192.2
/etc/sysconfig/network-scripts/ifcfg-eth0
=========================================
DEVICE=eth0
ONBOOT=yes
IPADDR=165.229.192.57
NETMASK=255.255.255.0
GATEWAY=165.229.192.2
TYPE=Ethernet
USERCTL=no
PEERDNS=no
NETWORK=165.229.192.0
BROADCAST=165.229.192.255
BOOTPROTO=none
/etc/sysconfig/network-scripts/ifcfg-eth1
=========================================
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
USERCTL=no
PEERDNS=yes
GATEWAY=165.229.192.57
TYPE=Ethernet
DEVICE=eth1
HWADDR=00:04:76:9d:f1:74
BOOTPROTO=none
NETMASK=255.255.255.0
ONBOOT=yes
IPADDR=192.168.0.4
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
I have added the routes like this, could you tell me is it right ?
route add default gw 165.229.192.2 dev eth0
route add -net 192.168.0.0 netmask 255.255.255.0 gw 165.229.192.57 dev eth0
I have used for eth1 gateway the eth0 ip address is it right ?
Note: 165.229.192.2 ==> is the cable for internet connection.
165.229.192.57 ==> is eth0 ip address
Looking forward for your reply
Thank you ...
Quote:
Originally Posted by penguintutor
My guess is that you have a default route set on both interfaces, so that when the new interface comes up it is routing the internet traffic through the local interface.
You can check this using
and check that you have a default gateway (destination 0.0.0.0) pointing at your Internet gateway address, and not your local one.
The default gateway is configured in
/etc/sysconfig/network
using an entry such as:
Code:
GATEWAY 192.168.1.1
replacing the ip address with your router / ISP router.
Any static routes for the local network (probably not required if they are just connected to the same subnet as the local interface) go into /etc/rc.local using the route command.
The /etc/sysconfig/network file is also used to define ip_forwarding - which is required for the machine to act as a router using
Your machine should then forward any traffic to the Internet.
I'd suggest you also take a look at adding some IPTABLE rules so that the gateway machine can act as a basic firewall.
If this hasn't fixed your problem, then a copy of the /etc/network, netstat -rn , and a
Code:
sudo /sbin/ifconfig -a
output may be helpful.
|