vikas027 |
04-30-2011 07:53 PM |
Use both networks simultaneously ppp0(usb device) and eth0
Hi All,
I am running a CentOS 5.6 as a Virtual Machine on my Laptop.
And, to connect to internet I am using a datacard (usb modem) device (Tata Photon +).
Now, internet is working well on my VM through interface ppp0
The problem is that when I start my interface eth0, internet (running through ppp0) stops.
Quote:
[root@kick ~]# ip route show
172.29.242.9 dev ppp0 proto kernel scope link src 14.99.211.189
default dev ppp0 scope link
[root@kick ~]# ip addr sh
1: lo: <LOOPBACK> mtu 16436 qdisc noop
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
link/ether 00:0c:29:57:c4:1c brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0c:29:57:c4:26 brd ff:ff:ff:ff:ff:ff
5: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 3
link/ppp
inet 14.99.211.189 peer 172.29.242.9/32 scope global ppp0
[root@kick ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.29.242.9 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ppp0
[root@kick ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.29.242.9 * 255.255.255.255 UH 0 0 0 ppp0
default * 0.0.0.0 U 0 0 0 ppp0
[root@kick ~]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
172.29.242.9 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ppp0
[root@kick ~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:29:57:C4:1C
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:67 Base address:0x2024
eth1 Link encap:Ethernet HWaddr 00:0C:29:57:C4:26
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:180 (180.0 b) TX bytes:5295 (5.1 KiB)
Interrupt:67 Base address:0x20a4
lo Link encap:Local Loopback
LOOPBACK MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
ppp0 Link encap:Point-to-Point Protocol
inet addr:14.99.211.189 P-t-P:172.29.242.9 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:323 errors:2 dropped:0 overruns:0 frame:0
TX packets:431 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:178008 (173.8 KiB) TX bytes:54394 (53.1 KiB)
|
These are the parameters of eth0 which I intend to use.
Code:
[root@kick ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0c:29:57:c4:1c
ONBOOT=yes
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.1.100
GATEWAY=192.168.1.1
I need to use this gateway as my other VMs have to connect this box via 192.168.1.1
I want both the network to run simultaneously, i.e. internet through ppp0 and my local network (192.168.1.0/24) through eth0.
I have never got an opportunity to work on routes yet, forgive my ignorance.
I know this can be solved by static routes, but I am unable to figure out how. :(
|