/etc/rc.d/netif wont add default gateway


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers /etc/rc.d/netif wont add default gateway
# 1  
Old 11-30-2007
/etc/rc.d/netif wont add default gateway

hi!

whenever i run /etc/rc.d/netif it will read rc.conf and add the pc IP and netmask but it wont read the default gateway resulting lost connectivity to internet

my rc.conf:
Quote:
defaultrouter="192.168.1.1"
hostname="msc.edu"
ifconfig_rl0="inet 192.168.1.9 netmask 255.255.255.0"
inetd_enable="YES"
linux_enable="YES"
saver="daemon"
sshd_enable="YES"
#usbd_enable="YES"
when i issue /etc/rc.d/netif restart:
Quote:
[root@msc ~]# /etc/rc.d/netif restart
Stopping network: lo0 rl0 plip0 pfsync0 pflog0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=8<VLAN_MTU>
inet 192.168.1.9 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:15:e9:7c:76:12
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
the result of running netif to routing tables:
[root@msc ~]# netstat -rn
Quote:
Routing tables

Internet:
Destination Gateway Flags Refs Use Netif Expire
127.0.0.1 127.0.0.1 UH 0 0 lo0
192.168.1 link#1 UC 0 0 rl0
192.168.1.10 00:0f:b0:84:97:80 UHLW 1 15 rl0 1146

Internet6:
Destination Gateway Flags Netif Expire
::1 ::1 UHL lo0
fe80::%lo0/64 fe80::1%lo0 U lo0
fe80::1%lo0 link#5 UHL lo0
ff01:5::/32 fe80::1%lo0 UC lo0
ff02::%lo0/32 fe80::1%lo0 UC lo0
i have to manually add default gateway to get my gateway back on routing tables:
Quote:
[root@msc ~]# route add default 192.168.1.1
add net default: gateway 192.168.1.1
Quote:
[root@msc ~]# netstat -rn
Routing tables

Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.1.1 UGS 0 0 rl0
127.0.0.1 127.0.0.1 UH 0 0 lo0
192.168.1 link#1 UC 0 0 rl0
192.168.1.1 link#1 UHLW 2 0 rl0
192.168.1.10 00:0f:b0:84:97:80 UHLW 1 54 rl0 1056

Internet6:
Destination Gateway Flags Netif Expire
::1 ::1 UHL lo0
fe80::%lo0/64 fe80::1%lo0 U lo0
fe80::1%lo0 link#5 UHL lo0
ff01:5::/32 fe80::1%lo0 UC lo0
ff02::%lo0/32 fe80::1%lo0 UC lo0
my question is, why /etc/rc.d/netif wont read directly from my /etc/rc.conf as I already stated the defaultrouter="192.168.1.1" there?

i'm on FreeBSD 6.2 on LAN
thanks for helping
# 2  
Old 12-01-2007
or anyone can assist me in creating a cronjob so it will check and add default gateway every x/minutes?

like:
Quote:
0,10,20,30,40,50 * * * * [*what should i script here*] >/dev/null 2>&1
# 3  
Old 12-04-2007
sadly no answer to this
i am asking because i have told as for my /etc/rc.conf changes to take effects, i must use /etc/rc.d/netif to restart the services
but i found it later that i will be disconnected from my remote terminal just because /etc/rc.d/netif wont care about routing
it's a pain to get connected back to the remote terminal

i've found out later that i must use /etc/rc.d/routing together with netif
for e.g:
Code:
/etc/rc.d/netif restart; /etc/rc.d/routing restart

/etc/rc.d/routing will re add back the routing tables after it has been flushed by /etc/rc.d/netif

thanks
# 4  
Old 12-04-2007
might want to read this forum thread.

HTML Code:
http://forums.bsdnexus.com/viewtopic.php?pid=12932
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Inconsistency between RedHat 6.5 global gateway and single gateway leads to loss of default gateway

Dear friends I use RedHat 6.5, which sets the gateway in the configuration file / etc / sysconfig / network as GATEWAY = 192.168.1.26, and the gateway in the configuration file / etc / sysconfig / network-scripts / ifcfg-eth11 as GATEWAY = 192.168.1.256. The two gateways are different.... (6 Replies)
Discussion started by: tanpeng
6 Replies

2. Linux

Unable to add route with a specific gateway IP

Hi, This is the routing table on a RHEL 7 server : # route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 10.132.81.145 0.0.0.0 UG 100 0 0 eno49 10.132.81.144 0.0.0.0 255.255.255.240 U 100 0 0 eno49... (4 Replies)
Discussion started by: anaigini45
4 Replies

3. Solaris

Cannot add gateway

Hi, OS: Solaris 11.2 64bit IP address: 172.16.10.10 Netmask: 255.255.254.0 Gateway: 172.16.2.254 From windows box, i can set and ping gateway. IP address is same segment with windows box. But on solaris i cannot set gateway. route add default 172.16.2.254 add net default: gateway... (6 Replies)
Discussion started by: mzainal
6 Replies

4. Solaris

how to add a default gateway in a zone of different VLAN of global zone

Hi Greetings... I have an issue in connecting the zone from outside the network and it is because of default gateway. I can ping default gateway from inside the zone and not able to ping from global zone due to different VLAN issue. If i add two different gateways and restart network services,... (2 Replies)
Discussion started by: vvpotugunta
2 Replies

5. Linux

GNUGK-How to setup static gateway to gateway routing

Dear Sir I am a newbie in the world of IP telephony. I have been working with Asterisk PBX (SIP) and Cisco Call Manager (MGCP) but now I am learning on how to work GNUGK for H.323 Gatekeeper. I am having a problem, configuring static call routing on GNUGK in the section ... (0 Replies)
Discussion started by: mfondoum
0 Replies

6. Solaris

Add gateway

Hi Community, I've a question about network adaptors. I've installed Solaris 10 configuring the ce0 port with an IP(10.23.8.15) , an interface_name (first) and a gateway(10.23.8.1) . I need to change the name of the interface ce0 and to configure another interface (ce1) with another... (1 Reply)
Discussion started by: Sunb3
1 Replies

7. HP-UX

How to add another default gateway

I am using HP-UX 11i and I need to add another default gateway. how can I do that ? (3 Replies)
Discussion started by: salhoub
3 Replies

8. UNIX for Dummies Questions & Answers

How to add 2 gateway routes?

I need some help adding routes in sco. I am using SCO Openserver 5.0.4. Basically I have 2 gateways here. The first is 10.15.1.1 and allows me access to the rest of the computers in the office and in other offices. The other gateway is 10.15.10.2 and is the sonicwall that will allow access... (3 Replies)
Discussion started by: cstovall
3 Replies

9. UNIX for Dummies Questions & Answers

Aix Add Gateway

I have a AIX lates OS. I;m trying to setup a remote office using a telnet section and for some reazon it wont let me login in to the server. I've done this type of configuration on a SCO 5.0.6 . In SCO there is a file call S99route and that is where you put the gateway and it works just... (3 Replies)
Discussion started by: josramon
3 Replies

10. UNIX for Dummies Questions & Answers

Add route gateway -> Restart !! Lose it

:confused: Hi: I donīt know how to add route gateway and when restart the machine lose this route and put other. In SCO ver 5.6 Enterprise write: etc\route delete gateway route add gateway 199.199.1.1. so , netstat -rn to see if has change -> all ok Restart -> !!!... (2 Replies)
Discussion started by: AlvaroD
2 Replies
Login or Register to Ask a Question